diff options
-rw-r--r-- | lib/psci/psci_common.c | 5 | ||||
-rw-r--r-- | lib/psci/psci_on.c | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c index ebeb10be9..c89347659 100644 --- a/lib/psci/psci_common.c +++ b/lib/psci/psci_common.c @@ -829,8 +829,11 @@ void psci_release_pwr_domain_locks(unsigned int end_pwrlvl, ******************************************************************************/ int psci_validate_mpidr(u_register_t mpidr) { - if (plat_core_pos_by_mpidr(mpidr) < 0) + int pos = plat_core_pos_by_mpidr(mpidr); + + if ((pos < 0) || ((unsigned int)pos >= PLATFORM_CORE_COUNT)) { return PSCI_E_INVALID_PARAMS; + } return PSCI_E_SUCCESS; } diff --git a/lib/psci/psci_on.c b/lib/psci/psci_on.c index 6c6b23c5a..76eb50ce5 100644 --- a/lib/psci/psci_on.c +++ b/lib/psci/psci_on.c @@ -65,13 +65,10 @@ int psci_cpu_on_start(u_register_t target_cpu, unsigned int target_idx; /* Calling function must supply valid input arguments */ + assert(ret >= 0); + assert((unsigned int)ret < PLATFORM_CORE_COUNT); assert(ep != NULL); - if ((ret < 0) || (ret >= (int)PLATFORM_CORE_COUNT)) { - ERROR("Unexpected core index.\n"); - panic(); - } - target_idx = (unsigned int)ret; /* |