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

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

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/char/lp.c linux/drivers/char/lp.c
@@ -119,6 +119,7 @@
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/sched.h>
+#include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/malloc.h>
 #include <linux/fcntl.h>
@@ -407,9 +408,11 @@
 {
 	unsigned int minor = MINOR(inode->i_rdev);
 
+	lock_kernel();
 	kfree_s(lp_table[minor].lp_buffer, LP_BUFFER_SIZE);
 	lp_table[minor].lp_buffer = NULL;
 	LP_F(minor) &= ~LP_BUSY;
+	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)