diff options
author | Soby Mathew <soby.mathew@arm.com> | 2014-10-02 17:24:19 +0100 |
---|---|---|
committer | Soby Mathew <soby.mathew@arm.com> | 2014-12-12 13:53:07 +0000 |
commit | 264999fc601e5b72e31aeb66101b57e409e2f68b (patch) | |
tree | b3b87aaaf0f3a9f914a563f8c402c40e1e0777f8 /services/std_svc/psci/psci_common.c | |
parent | 29e32cba4ad243071c643c839dfd4f46a0b19655 (diff) |
Fix CPU_SUSPEND when invoked with affinity level higher than get_max_afflvl()
This patch fixes the assertion failure when CPU_SUSPEND is invoked with
an affinity level higher than supported by the platform by adding suitable
checks for affinity level within `psci_cpu_suspend`. Also added suitable
bound checks within `psci_aff_map_get_idx` to prevent indexing beyond array
limits.
Fixes ARM-software/tf-issues#260
Change-Id: I04b75c49729e6c6d1983add590f60146c8fc3630
Diffstat (limited to 'services/std_svc/psci/psci_common.c')
-rw-r--r-- | services/std_svc/psci/psci_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/std_svc/psci/psci_common.c b/services/std_svc/psci/psci_common.c index 2267ad08..155f842e 100644 --- a/services/std_svc/psci/psci_common.c +++ b/services/std_svc/psci/psci_common.c @@ -201,7 +201,7 @@ unsigned long mpidr_set_aff_inst(unsigned long mpidr, int psci_check_afflvl_range(int start_afflvl, int end_afflvl) { /* Sanity check the parameters passed */ - if (end_afflvl > MPIDR_MAX_AFFLVL) + if (end_afflvl > get_max_afflvl()) return PSCI_E_INVALID_PARAMS; if (start_afflvl < MPIDR_AFFLVL0) |