linux-stable/drivers/firmware/arm_scmi
Ludvig Pärsson 44dbdf3bb3 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>
2022-06-12 19:59:55 +01:00
..
Kconfig firmware: arm_scmi: Support optee shared memory in the optee transport 2022-04-28 18:22:53 +01:00
Makefile firmware: arm_scmi: Disable ftrace for Clang Thumb2 builds 2022-02-08 23:06:40 +00:00
base.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
bus.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
clock.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
common.h firmware: arm_scmi: Split protocol specific definitions in a dedicated header 2022-04-28 18:22:51 +01:00
driver.c firmware: arm_scmi: Fix late checks on pointer dereference 2022-05-03 14:23:02 +01:00
mailbox.c firmware: arm_scmi: Add new parameter to mark_txdone 2021-12-21 10:59:38 +00:00
msg.c firmware: arm_scmi: Add message passing abstractions for transports 2021-08-05 10:23:23 +01:00
notify.c firmware: arm_scmi: Fix kernel doc warnings about return values 2021-07-13 11:39:54 +01:00
notify.h firmware: arm_scmi: Remove duplicate declaration of struct scmi_protocol_handle 2021-04-27 11:57:26 +01:00
optee.c firmware: arm_scmi: Support optee shared memory in the optee transport 2022-04-28 18:22:53 +01:00
perf.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
power.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
protocols.h firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
reset.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
scmi_pm_domain.c firmware: arm_scmi: pm: Propagate return value to caller 2021-11-17 11:24:50 +00:00
sensors.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
shmem.c firmware: arm_scmi: Rename .clear_notification() transport_ops 2020-04-20 17:25:26 +01:00
smc.c firmware: arm_scmi: Add new parameter to mark_txdone 2021-12-21 10:59:38 +00:00
system.c firmware: arm_scmi: Split protocol specific definitions in a dedicated header 2022-04-28 18:22:51 +01:00
virtio.c firmware: arm_scmi: Add atomic mode support to virtio transport 2022-02-21 10:36:48 +00:00
voltage.c firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get 2022-06-12 19:59:55 +01:00