From: tony.xie Date: Mon, 15 May 2017 02:36:14 +0000 (+0800) Subject: rockchip: rk3328: Add assert check in pmu.c X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6bf14e1d6ef0702a16fd7e6284b666fd04e8c8ea;p=project%2Fbcm63xx%2Fatf.git rockchip: rk3328: Add assert check in pmu.c Add assert() check for cpuson_flags[] and cpuson_entry_point[]. Change-Id: I971fe54c2baa3b4514a3979042341220f5e20901 Signed-off-by: tony.xie --- diff --git a/plat/rockchip/rk3328/drivers/pmu/pmu.c b/plat/rockchip/rk3328/drivers/pmu/pmu.c index da013ddf..59d399be 100644 --- a/plat/rockchip/rk3328/drivers/pmu/pmu.c +++ b/plat/rockchip/rk3328/drivers/pmu/pmu.c @@ -144,6 +144,7 @@ int rockchip_soc_cores_pwr_dm_on(unsigned long mpidr, uint64_t entrypoint) { uint32_t cpu_id = plat_core_pos_by_mpidr(mpidr); + assert(cpu_id < PLATFORM_CORE_COUNT); assert(cpuson_flags[cpu_id] == 0); cpuson_flags[cpu_id] = PMU_CPU_HOTPLUG; cpuson_entry_point[cpu_id] = entrypoint; @@ -167,6 +168,7 @@ int rockchip_soc_cores_pwr_dm_suspend(void) { uint32_t cpu_id = plat_my_core_pos(); + assert(cpu_id < PLATFORM_CORE_COUNT); assert(cpuson_flags[cpu_id] == 0); cpuson_flags[cpu_id] = PMU_CPU_AUTO_PWRDN; cpuson_entry_point[cpu_id] = (uintptr_t)plat_get_sec_entrypoint();