summaryrefslogtreecommitdiff
path: root/plat/rockchip
diff options
context:
space:
mode:
authorCaesar Wang <wxt@rock-chips.com>2018-01-30 09:11:24 +0800
committerCaesar Wang <wxt@rock-chips.com>2018-01-30 14:31:37 +0800
commitde3c30073e2e781f4b579ee94fa8d00667042b97 (patch)
tree65e57f02c0dbfbfd9d6688b75ad0524f2d551084 /plat/rockchip
parente47541ac6ef58b213fd915253e16e6fa1ae3b4a9 (diff)
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 <wxt@rock-chips.com>
Diffstat (limited to 'plat/rockchip')
-rw-r--r--plat/rockchip/rk3399/drivers/pmu/pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plat/rockchip/rk3399/drivers/pmu/pmu.c b/plat/rockchip/rk3399/drivers/pmu/pmu.c
index c666c3c2..5c586aaa 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;