aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/softirq.c
diff options
context:
space:
mode:
authorAkinobu Mita <mita@miraclelinux.com>2006-09-29 05:00:22 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:14 -0400
commit07dccf3344010f9b9df7fe725da7e73bca2992df (patch)
tree696730ef4e1bf85a24eac84713921746f74c7c10 /kernel/softirq.c
parent6c2d8b5dcad468cb0bdec3368b53383bde51e487 (diff)
[PATCH] check return value of cpu_callback
Spawing ksoftirqd, migration, or watchdog, and calling init_timers_cpu() may fail with small memory. If it happens in initcalls, kernel NULL pointer dereference happens later. This patch makes crash happen immediately in such cases. It seems a bit better than getting kernel NULL pointer dereference later. Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r--kernel/softirq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 3789ca98197c..bf25015dce16 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -612,7 +612,9 @@ static struct notifier_block __cpuinitdata cpu_nfb = {
612__init int spawn_ksoftirqd(void) 612__init int spawn_ksoftirqd(void)
613{ 613{
614 void *cpu = (void *)(long)smp_processor_id(); 614 void *cpu = (void *)(long)smp_processor_id();
615 cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); 615 int err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
616
617 BUG_ON(err == NOTIFY_BAD);
616 cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); 618 cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
617 register_cpu_notifier(&cpu_nfb); 619 register_cpu_notifier(&cpu_nfb);
618 return 0; 620 return 0;