Skip to content

Commit 9ffdc6c

Browse files
mslusarzIngo Molnar
authored andcommitted
watchdog: Don't change watchdog state on read of sysctl
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> [ add {}'s to fix a warning ] Signed-off-by: Don Zickus <dzickus@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: <stable@kernel.org> LKML-Reference: <1296230433-6261-3-git-send-email-dzickus@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 3973576 commit 9ffdc6c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎kernel/watchdog.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,12 @@ int proc_dowatchdog_enabled(struct ctl_table *table, int write,
493493
{
494494
proc_dointvec(table, write, buffer, length, ppos);
495495

496-
if (watchdog_enabled)
497-
watchdog_enable_all_cpus();
498-
else
499-
watchdog_disable_all_cpus();
496+
if (write) {
497+
if (watchdog_enabled)
498+
watchdog_enable_all_cpus();
499+
else
500+
watchdog_disable_all_cpus();
501+
}
500502
return 0;
501503
}
502504

0 commit comments

Comments
 (0)