Fix CPU_SUSPEND when invoked with affinity level higher than get_max_afflvl()
authorSoby Mathew <soby.mathew@arm.com>
Thu, 2 Oct 2014 16:24:19 +0000 (17:24 +0100)
committerSoby Mathew <soby.mathew@arm.com>
Fri, 12 Dec 2014 13:53:07 +0000 (13:53 +0000)
commit264999fc601e5b72e31aeb66101b57e409e2f68b
treeb3b87aaaf0f3a9f914a563f8c402c40e1e0777f8
parent29e32cba4ad243071c643c839dfd4f46a0b19655
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
services/std_svc/psci/psci_common.c
services/std_svc/psci/psci_main.c
services/std_svc/psci/psci_setup.c