Kees Cook
70fa727835
ARM: vexpress/spc: Avoid negative array index when !SMP
...
[ Upstream commit b3f1dd52c991d79118f35e6d1bf4d7cb09882e38 ]
When building multi_v7_defconfig+CONFIG_SMP=n, -Warray-bounds exposes
a couple negative array index accesses:
arch/arm/mach-vexpress/spc.c: In function 've_spc_clk_init':
arch/arm/mach-vexpress/spc.c:583:21: warning: array subscript -1 is below array bounds of 'bool[2]' {aka '_Bool[2]'} [-Warray-bounds]
583 | if (init_opp_table[cluster])
| ~~~~~~~~~~~~~~^~~~~~~~~
arch/arm/mach-vexpress/spc.c:556:7: note: while referencing 'init_opp_table'
556 | bool init_opp_table[MAX_CLUSTERS] = { false };
| ^~~~~~~~~~~~~~
arch/arm/mach-vexpress/spc.c:592:18: warning: array subscript -1 is below array bounds of 'bool[2]' {aka '_Bool[2]'} [-Warray-bounds]
592 | init_opp_table[cluster] = true;
| ~~~~~~~~~~~~~~^~~~~~~~~
arch/arm/mach-vexpress/spc.c:556:7: note: while referencing 'init_opp_table'
556 | bool init_opp_table[MAX_CLUSTERS] = { false };
| ^~~~~~~~~~~~~~
Skip this logic when built !SMP.
Link: https://lore.kernel.org/r/20220331190443.851661-1-keescook@chromium.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-27 14:38:55 +02:00
..
2022-04-13 20:59:14 +02:00
2022-04-08 14:24:01 +02:00
2022-04-27 14:38:55 +02:00
2022-04-27 14:38:55 +02:00
2022-04-08 14:24:01 +02:00
2021-09-08 12:55:35 -07:00
2022-03-28 09:58:45 +02:00
2022-02-01 17:27:05 +01:00
2022-04-08 14:23:20 +02:00
2022-04-08 14:23:18 +02:00
2022-04-13 20:59:09 +02:00
2022-03-28 09:58:46 +02:00
2022-04-08 14:24:01 +02:00
2022-01-27 11:04:10 +01:00
2022-04-13 20:59:14 +02:00
2022-04-13 20:59:28 +02:00
2022-04-13 20:59:09 +02:00
2022-03-08 19:12:48 +01:00
2022-01-27 11:05:21 +01:00
2022-04-08 14:24:01 +02:00
2022-04-13 20:58:59 +02:00
2022-04-20 09:34:20 +02:00
2022-04-13 20:59:09 +02:00
2022-04-08 14:23:06 +02:00