patch-2.4.0-test4 linux/drivers/char/sbc60xxwdt.c

Next file: linux/drivers/char/softdog.c
Previous file: linux/drivers/char/rtc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/char/sbc60xxwdt.c linux/drivers/char/sbc60xxwdt.c
@@ -66,6 +66,7 @@
 #include <linux/malloc.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
+#include <linux/smp_lock.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -207,6 +208,7 @@
 
 static int fop_close(struct inode * inode, struct file * file)
 {
+	lock_kernel();
 	if(MINOR(inode->i_rdev) == WATCHDOG_MINOR) 
 	{
 		if(wdt_expect_close)
@@ -217,6 +219,7 @@
 		}
 	}
 	wdt_is_open = 0;
+	unlock_kernel();
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)