[patch 133/176] watchdog: Dont change watchdog state on read of sysctl

From: Greg KH
Date: Tue Feb 15 2011 - 20:00:50 EST


2.6.36-stable review patch. If anyone has any objections, please let us know.

------------------

From: Marcin Slusarz <marcin.slusarz@xxxxxxxxx>

commit 9ffdc6c37df131f89d52001e0ef03091b158826f upstream.

Signed-off-by: Marcin Slusarz <marcin.slusarz@xxxxxxxxx>
[ add {}'s to fix a warning ]
Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
LKML-Reference: <1296230433-6261-3-git-send-email-dzickus@xxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
kernel/watchdog.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -505,10 +505,12 @@ int proc_dowatchdog_enabled(struct ctl_t
{
proc_dointvec(table, write, buffer, length, ppos);

- if (watchdog_enabled)
- watchdog_enable_all_cpus();
- else
- watchdog_disable_all_cpus();
+ if (write) {
+ if (watchdog_enabled)
+ watchdog_enable_all_cpus();
+ else
+ watchdog_disable_all_cpus();
+ }
return 0;
}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/