diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-09-29 05:00:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 12:18:14 -0400 |
commit | 07dccf3344010f9b9df7fe725da7e73bca2992df (patch) | |
tree | 696730ef4e1bf85a24eac84713921746f74c7c10 /kernel/sched.c | |
parent | 6c2d8b5dcad468cb0bdec3368b53383bde51e487 (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/sched.c')
-rw-r--r-- | kernel/sched.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 5c848fd4e461..b946209d9c15 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -5272,9 +5272,11 @@ static struct notifier_block __cpuinitdata migration_notifier = { | |||
5272 | int __init migration_init(void) | 5272 | int __init migration_init(void) |
5273 | { | 5273 | { |
5274 | void *cpu = (void *)(long)smp_processor_id(); | 5274 | void *cpu = (void *)(long)smp_processor_id(); |
5275 | int err; | ||
5275 | 5276 | ||
5276 | /* Start one for the boot CPU: */ | 5277 | /* Start one for the boot CPU: */ |
5277 | migration_call(&migration_notifier, CPU_UP_PREPARE, cpu); | 5278 | err = migration_call(&migration_notifier, CPU_UP_PREPARE, cpu); |
5279 | BUG_ON(err == NOTIFY_BAD); | ||
5278 | migration_call(&migration_notifier, CPU_ONLINE, cpu); | 5280 | migration_call(&migration_notifier, CPU_ONLINE, cpu); |
5279 | register_cpu_notifier(&migration_notifier); | 5281 | register_cpu_notifier(&migration_notifier); |
5280 | 5282 | ||