Merge "fix(psci): do not panic on illegal MPIDR" into integration

This commit is contained in:
Manish Pandey 2023-05-10 18:56:46 +02:00 committed by TrustedFirmware Code Review
commit 8700c6f784
2 changed files with 6 additions and 6 deletions

View file

@ -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;
}

View file

@ -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;
/*