stm32mp: fix various array bounds checks
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 24 Mar 2023 07:55:19 +0000 (08:55 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Wed, 19 Apr 2023 08:02:28 +0000 (10:02 +0200)
commitdaf07215e8c4aed16af81e1615396f5502040c1f
treebc6f4a5b69b81b1761c2751511defabd97feb28a
parentbb0352009822239044ac7f2eafcdff8c71d56ed2
stm32mp: fix various array bounds checks

In all these cases, the index on the LHS is immediately afterwards
used to access the array appearing in the ARRAY_SIZE() on the RHS - so
if that index is equal to the array size, we'll access
one-past-the-end of the array.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
arch/arm/mach-stm32mp/cpu.c
board/st/stm32mp1/stm32mp1.c
drivers/ram/stm32mp1/stm32mp1_interactive.c