[PATCH] Fix softdog no reboot on unexpected close

Linux Kernel Mailing List <[email protected]> Wed, 16 Mar 2005 12:22:37 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1579, 2005/03/16 09:22:37-03:00, [email protected]

	[PATCH] Fix softdog no reboot on unexpected close
	
	There is a bug in the softdog.c (v 0.05) in the 2.4 kernel series
	(certainly in 2.4.29 and there are no references to it in the latest
	Changelog) that won't reboot the machine if /dev/watchdog is closed
	unexpectedly and nowayout is not set. The softdog.c (v 0.07) in 2.6.11
	is not affected, but I have been informed by the vendor of analog output
	cards that we use (ICP DAS) that they currently have no plans to port
	their driver to the 2.6 series.
	
	Anyway, here is a simple patch that does the job.



 softdog.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/char/softdog.c b/drivers/char/softdog.c
--- a/drivers/char/softdog.c	2005-03-16 15:02:41 -08:00
+++ b/drivers/char/softdog.c	2005-03-16 15:02:41 -08:00
@@ -124,7 +124,7 @@
 	 *	Shut off the timer.
 	 * 	Lock it in if it's a module and we set nowayout
 	 */
-	if (expect_close || nowayout == 0) {
+	if (expect_close && nowayout == 0) {
 		del_timer(&watchdog_ticktock);
 	} else {
 		printk(KERN_CRIT "SOFTDOG: WDT device closed unexpectedly.  WDT will not stop!\n");