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

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

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/char/qpmouse.c linux/drivers/char/qpmouse.c
@@ -36,6 +36,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
+#include <linux/smp_lock.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -141,6 +142,7 @@
 {
 	unsigned char status;
 
+	lock_kernel();
 	fasync_qp(-1, file, 0);
 	if (!--qp_count) {
 		if (!poll_qp_status())
@@ -151,6 +153,7 @@
 			printk("Warning: Mouse device busy in release_qp()\n");
 		free_irq(QP_IRQ, NULL);
 	}
+	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)