summaryrefslogtreecommitdiffstats
path: root/kernel/softlockup.c
diff options
context:
space:
mode:
authorAkinobu Mita <mita@miraclelinux.com>2006-09-29 02:00:22 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 09:18:14 -0700
commit07dccf3344010f9b9df7fe725da7e73bca2992df (patch)
tree696730ef4e1bf85a24eac84713921746f74c7c10 /kernel/softlockup.c
parent6c2d8b5dcad468cb0bdec3368b53383bde51e487 (diff)
downloadlinux-07dccf3344010f9b9df7fe725da7e73bca2992df.tar.gz
linux-07dccf3344010f9b9df7fe725da7e73bca2992df.tar.bz2
linux-07dccf3344010f9b9df7fe725da7e73bca2992df.zip
[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/softlockup.c')
-rw-r--r--kernel/softlockup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index 03e6a2b0b787..50afeb813305 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -149,8 +149,9 @@ static struct notifier_block __cpuinitdata cpu_nfb = {
__init void spawn_softlockup_task(void)
{
void *cpu = (void *)(long)smp_processor_id();
+ int err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
- cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
+ BUG_ON(err == NOTIFY_BAD);
cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
register_cpu_notifier(&cpu_nfb);