mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
powerpc/powernv: Get cpu only after validity check
Check for validity of cpu before calling get_hard_smp_processor_id(). Found with coverity. Signed-off-by: Santosh Sivaraj <santosh@fossix.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
520eccdfe1
commit
76d98ab462
1 changed files with 2 additions and 1 deletions
|
@ -57,7 +57,7 @@ static void pnv_smp_setup_cpu(int cpu)
|
|||
|
||||
static int pnv_smp_kick_cpu(int nr)
|
||||
{
|
||||
unsigned int pcpu = get_hard_smp_processor_id(nr);
|
||||
unsigned int pcpu;
|
||||
unsigned long start_here =
|
||||
__pa(ppc_function_entry(generic_secondary_smp_init));
|
||||
long rc;
|
||||
|
@ -66,6 +66,7 @@ static int pnv_smp_kick_cpu(int nr)
|
|||
if (nr < 0 || nr >= nr_cpu_ids)
|
||||
return -EINVAL;
|
||||
|
||||
pcpu = get_hard_smp_processor_id(nr);
|
||||
/*
|
||||
* If we already started or OPAL is not supported, we just
|
||||
* kick the CPU via the PACA
|
||||
|
|
Loading…
Reference in a new issue