From de3c30073e2e781f4b579ee94fa8d00667042b97 Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Tue, 30 Jan 2018 09:11:24 +0800 Subject: [PATCH] rockchip/rk3399: Fix memory corruptions or illegal memory access Coverity scan done for the coreboot project found the issue: Coverity (*** CID 1385418: Memory - illegal accesses (OVERRUN)) Coverity (*** CID 1385419: Memory - corruptions (OVERRUN)) Fix the Converity error issue with store_cru[] loop needs to be one element bigger. Fixes: ARM-software/tf-issues#544 Change-Id: I420f0a660b24baaa5fc5e78fca242cf750c9bbc7 Signed-off-by: Caesar Wang --- plat/rockchip/rk3399/drivers/pmu/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/rockchip/rk3399/drivers/pmu/pmu.c b/plat/rockchip/rk3399/drivers/pmu/pmu.c index c666c3c20..5c586aaaf 100644 --- a/plat/rockchip/rk3399/drivers/pmu/pmu.c +++ b/plat/rockchip/rk3399/drivers/pmu/pmu.c @@ -32,7 +32,7 @@ DEFINE_BAKERY_LOCK(rockchip_pd_lock); static uint32_t cpu_warm_boot_addr; static char store_sram[SRAM_BIN_LIMIT + SRAM_TEXT_LIMIT + SRAM_DATA_LIMIT]; -static uint32_t store_cru[CRU_SDIO0_CON1 / 4]; +static uint32_t store_cru[CRU_SDIO0_CON1 / 4 + 1]; static uint32_t store_usbphy0[7]; static uint32_t store_usbphy1[7]; static uint32_t store_grf_io_vsel;