mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
[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>
This commit is contained in:
parent
6c2d8b5dca
commit
07dccf3344
4 changed files with 11 additions and 4 deletions
|
@ -1694,8 +1694,10 @@ static struct notifier_block __cpuinitdata timers_nb = {
|
|||
|
||||
void __init init_timers(void)
|
||||
{
|
||||
timer_cpu_notify(&timers_nb, (unsigned long)CPU_UP_PREPARE,
|
||||
int err = timer_cpu_notify(&timers_nb, (unsigned long)CPU_UP_PREPARE,
|
||||
(void *)(long)smp_processor_id());
|
||||
|
||||
BUG_ON(err == NOTIFY_BAD);
|
||||
register_cpu_notifier(&timers_nb);
|
||||
open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue