fix array boundary check in find_logical_id

When we are trying to find the array index for a given MPIDR, we check
that we don't overrun the array boundary, by comparing against NR_CPUS.
However the resulting conditional branch should also fire when we reach
the exact number of elements, since it's all 0 based.

Change the comparison to be '>=' instead of just '>', to only allow
array indicies 0 .. (NR_CPUS - 1).

Signed-off-by: Andre Przywara <>
Signed-off-by: Mark Rutland <>
2 files changed