diff options
author | Stephane Eranian <eranian@google.com> | 2010-09-14 15:34:01 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-15 10:43:58 +0200 |
commit | d9ca07a05ce1c42ac9717e54eaea4546a3a80978 (patch) | |
tree | a6200b56afa330bf2b4b61d2485c44362a0f0c80 /kernel/watchdog.c | |
parent | 3aabae7d9dfaed60effe93662f02c19bafc18537 (diff) |
watchdog: Avoid kernel crash when disabling watchdog
In case you boot with the watchdog disabled, i.e., nowatchdog, then,
if you try to disable it via /proc/sys/kernel/watchdog, you get
a kernel crash. The reason is that you are trying to cancel a hrtimer
which has never been initialized.
This patch fixes this by skipping execution of
watchdog_disable_all_cpus() when the watchdog is marked
disabled from boot.
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <4c8f7a23.cae9d80a.2c11.0bb4@mx.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r-- | kernel/watchdog.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index fa71aebda4ff..89eadbb9cefe 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -473,6 +473,9 @@ static void watchdog_disable_all_cpus(void) { int cpu; + if (no_watchdog) + return; + for_each_online_cpu(cpu) watchdog_disable(cpu); |