From: Rusty Russell Date: Wed, 31 Dec 2008 23:42:14 +0000 (+1030) Subject: percpu: fix percpu accessors to potentially !cpu_possible() cpus: m32r X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e2f913df70b378379a358a44e7d286f7b765e8e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git percpu: fix percpu accessors to potentially !cpu_possible() cpus: m32r Impact: CPU iterator bugfixes Percpu areas are only allocated for possible cpus. In general, you shouldn't access random cpu's percpu areas. Signed-off-by: Rusty Russell Signed-off-by: Mike Travis Acked-by: Ingo Molnar Acked-by: Hirokazu Takata --- diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index 0f06b3722e96..2547d6c4a827 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c @@ -592,7 +592,7 @@ int setup_profiling_timer(unsigned int multiplier) * accounting. At that time they also adjust their APIC timers * accordingly. */ - for (i = 0; i < NR_CPUS; ++i) + for_each_possible_cpu(i) per_cpu(prof_multiplier, i) = multiplier; return 0;