Fix an off-by-one error in the logic that checks if a CPU is present.
The ncores variable is a count of cores while the cpu variable is a
0 based index. So if ncores == cpu, cpu is out of range. Fix this
comparison so non-existent CPUs are not probed.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
u32 trampoline_code_size = &zynq_secondary_trampoline_end -
&zynq_secondary_trampoline;
- if (cpu > ncores) {
+ if (cpu >= ncores) {
pr_warn("CPU No. is not available in the system\n");
return -1;
}