mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
parisc: Fix crash with nr_cpus=1 option
commit d3b3c637e4
upstream.
John David Anglin reported that giving "nr_cpus=1" on the command
line causes a crash, while "maxcpus=1" works.
Reported-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.18+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c9969a3d31
commit
161fa3dfd5
1 changed files with 3 additions and 1 deletions
|
@ -440,7 +440,9 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
|
||||||
if (cpu_online(cpu))
|
if (cpu_online(cpu))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (num_online_cpus() < setup_max_cpus && smp_boot_one_cpu(cpu, tidle))
|
if (num_online_cpus() < nr_cpu_ids &&
|
||||||
|
num_online_cpus() < setup_max_cpus &&
|
||||||
|
smp_boot_one_cpu(cpu, tidle))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
return cpu_online(cpu) ? 0 : -EIO;
|
return cpu_online(cpu) ? 0 : -EIO;
|
||||||
|
|
Loading…
Reference in a new issue