diff options
author | Ludvig Pärsson | 2022-06-10 16:00:55 +0200 |
---|---|---|
committer | Sudeep Holla | 2022-06-12 19:59:55 +0100 |
commit | 44dbdf3bb3f44bf08897ed5f22eb262edcf3d926 (patch) | |
tree | 8f7489ae086c3069827840d49358fa3ebe943e4b /lib/uuid.c | |
parent | 4314f9f4f85832b5082f4e38b07b63b11baa538c (diff) |
firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get
scmi_voltage_descriptors_get() will incorrecly return an error code if
the last iteration of the for loop that retrieves the descriptors is
skipped due to an error. Skipping an iteration in the loop is not an
error, but the `ret` value from the last iteration will be propagated
when the function returns.
Fix by not saving return values that should not be propagated. This
solution also minimizes the risk of future patches accidentally
re-introducing this bug.
Link: https://lore.kernel.org/r/20220610140055.31491-1-ludvig.parsson@axis.com
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Ludvig Pärsson <ludvig.parsson@axis.com>
[sudeep.holla: Removed unneeded reset_rx_to_maxsz and check for return
value from scmi_voltage_levels_get as suggested by Cristian]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'lib/uuid.c')
0 files changed, 0 insertions, 0 deletions