[ 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:
|
||
|---|---|---|
| .. | ||
| Makefile | ||
| base.c | ||
| bus.c | ||
| clock.c | ||
| common.h | ||
| driver.c | ||
| mailbox.c | ||
| notify.c | ||
| notify.h | ||
| perf.c | ||
| power.c | ||
| reset.c | ||
| scmi_pm_domain.c | ||
| sensors.c | ||
| shmem.c | ||
| smc.c | ||
| system.c | ||