board: ten64: Fix OOB read in ft_board_setup

base and size arrays can both contain up to total_memory_banks
elements.
This commit fixes the for loop condition to ensure that it does
not attempt to read past the end of both arrays.

Signed-off-by: Francois Berder <fberder@outlook.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Francois Berder
2026-05-09 21:24:17 +02:00
committed by Peng Fan
parent 408cab5f9d
commit 12cf77821d

View File

@@ -285,7 +285,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
}
if (mc_memory_base != 0) {
for (i = 0; i <= total_memory_banks; i++) {
for (i = 0; i < total_memory_banks; i++) {
if (base[i] == 0 && size[i] == 0) {
base[i] = mc_memory_base;
size[i] = mc_memory_size;