summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-05-19 12:12:06 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-30 14:17:22 +0100
commitafee0f4b114f7a046c960e53c033b4ac1e03a8cb (patch)
tree00ba016ee4bf5c9c4c4b16926006d942681299ec
parent125e244ac8027c30ea06c72ab437ef8b4857fea2 (diff)
downloadlinux-stable-afee0f4b114f7a046c960e53c033b4ac1e03a8cb.tar.gz
linux-stable-afee0f4b114f7a046c960e53c033b4ac1e03a8cb.tar.bz2
linux-stable-afee0f4b114f7a046c960e53c033b4ac1e03a8cb.zip
parisc: Use num_present_cpus() in alternative patching code
commit b6405f0829d7b1dd926ba3ca5f691cab835abfaa upstream. When patching the kernel code some alternatives depend on SMP vs. !SMP. Use the value of num_present_cpus() instead of num_online_cpus() to decide, otherwise we may run into issues if and additional CPU is enabled after having loaded a module while only one CPU was enabled. Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> # v6.1+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/parisc/kernel/alternative.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/parisc/kernel/alternative.c b/arch/parisc/kernel/alternative.c
index 66f5672c70bd..25c4d6c3375d 100644
--- a/arch/parisc/kernel/alternative.c
+++ b/arch/parisc/kernel/alternative.c
@@ -25,7 +25,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
{
struct alt_instr *entry;
int index = 0, applied = 0;
- int num_cpus = num_online_cpus();
+ int num_cpus = num_present_cpus();
u16 cond_check;
cond_check = ALT_COND_ALWAYS |