Commit d9ca07a0 authored by Stephane Eranian's avatar Stephane Eranian Committed by Ingo Molnar

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: default avatarStephane Eranian <eranian@google.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <4c8f7a23.cae9d80a.2c11.0bb4@mx.google.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3aabae7d
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment