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

Next file: linux/drivers/char/pcmcia/Config.in
Previous file: linux/drivers/char/pc110pad.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c
@@ -31,6 +31,7 @@
 #include <linux/miscdevice.h>
 #include <linux/malloc.h>
 #include <linux/kbd_kern.h>
+#include <linux/smp_lock.h>
 
 #include <asm/keyboard.h>
 #include <asm/bitops.h>
@@ -872,12 +873,16 @@
 
 static int release_aux(struct inode * inode, struct file * file)
 {
+	lock_kernel();
 	fasync_aux(-1, file, 0);
-	if (--aux_count)
+	if (--aux_count) {
+		unlock_kernel();
 		return 0;
+	}
 	kbd_write_cmd(AUX_INTS_OFF);			    /* Disable controller ints */
 	kbd_write_command_w(KBD_CCMD_MOUSE_DISABLE);
 	aux_free_irq(AUX_DEV);
+	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)