diff options
author | Manish Pandey <manish.pandey2@arm.com> | 2023-05-10 18:56:46 +0200 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2023-05-10 18:56:46 +0200 |
commit | 8700c6f784c5029aa09696980c0a9b0ea9962f98 (patch) | |
tree | 2652364ad3a30df5109f1f7e7ae95cdaff96ed6e | |
parent | b967ca06bd490da89fc421198fe0caa5f385c367 (diff) | |
parent | 8a6d0d262ae03db0a0bedd047a2df6f95e8823f6 (diff) | |
download | arm-trusted-firmware-8700c6f784c5029aa09696980c0a9b0ea9962f98.tar.gz |
Merge "fix(psci): do not panic on illegal MPIDR" into integration
-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; /* |