OrangePi_CM5/drivers/firmware/arm_scmi
Cristian Marussi 1052f22e12 firmware: arm_scmi: Fix list protocols enumeration in the base protocol
[ Upstream commit 8009120e0354a67068e920eb10dce532391361d0 ]

While enumerating protocols implemented by the SCMI platform using
BASE_DISCOVER_LIST_PROTOCOLS, the number of returned protocols is
currently validated in an improper way since the check employs a sum
between unsigned integers that could overflow and cause the check itself
to be silently bypassed if the returned value 'loop_num_ret' is big
enough.

Fix the validation avoiding the addition.

Link: https://lore.kernel.org/r/20220330150551.2573938-4-cristian.marussi@arm.com
Fixes: b6f20ff8bd ("firmware: arm_scmi: add common infrastructure and support for base protocol")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:21:15 +02:00
..
Makefile
…
base.c firmware: arm_scmi: Fix list protocols enumeration in the base protocol 2022-06-09 10:21:15 +02:00
bus.c firmware: arm_scmi: Ensure drivers provide a probe function 2021-08-08 09:05:23 +02:00
clock.c firmware: arm_scmi: Fix sorting of retrieved clock rates 2022-04-20 09:23:10 +02:00
common.h firmware: arm_scmi: Add SMCCC discovery dependency in Kconfig 2021-07-25 14:36:14 +02:00
driver.c firmware: arm_scmi: Remove space in MODULE_ALIAS name 2022-03-08 19:09:35 +01:00
mailbox.c
…
notify.c
…
notify.h
…
perf.c
…
power.c
…
reset.c
…
scmi_pm_domain.c firmware: arm_scmi: pm: Propagate return value to caller 2021-12-01 09:19:03 +01:00
sensors.c
…
shmem.c
…
smc.c
…
system.c
…