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

Next file: linux/drivers/char/joystick/Config.in
Previous file: linux/drivers/char/i2c-parport.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/char/i810_rng.c linux/drivers/char/i810_rng.c
@@ -165,6 +165,7 @@
 #include <linux/random.h>
 #include <linux/sysctl.h>
 #include <linux/miscdevice.h>
+#include <linux/smp_lock.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -626,12 +627,16 @@
 static int rng_dev_release (struct inode *inode, struct file *filp)
 {
 
-	if (rng_enable(0) != 0)
+	lock_kernel();
+	if (rng_enable(0) != 0) {
+		unlock_kernel();
 		return -EIO;
+	}
 
 	spin_lock_bh (&rng_lock);
 	rng_open = 0;
 	spin_unlock_bh (&rng_lock);
+	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)