percpu: fix percpu accessors to potentially !cpu_possible() cpus: m32r
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Dec 2008 23:42:14 +0000 (10:12 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Dec 2008 23:42:14 +0000 (10:12 +1030)
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 <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Hirokazu Takata <takata@linux-m32r.org>
arch/m32r/kernel/smpboot.c

index 0f06b37..2547d6c 100644 (file)
@@ -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;