Skip to content

Commit b6405f0

Browse files
committed
parisc: Use num_present_cpus() in alternative patching code
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 <[email protected]> Cc: <[email protected]> # v6.1+
1 parent d703797 commit b6405f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/parisc/kernel/alternative.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
2525
{
2626
struct alt_instr *entry;
2727
int index = 0, applied = 0;
28-
int num_cpus = num_online_cpus();
28+
int num_cpus = num_present_cpus();
2929
u16 cond_check;
3030

3131
cond_check = ALT_COND_ALWAYS |

0 commit comments

Comments
 (0)