patch-2.4.0-test4 linux/drivers/block/paride/pg.c

Next file: linux/drivers/block/paride/pt.c
Previous file: linux/drivers/block/paride/paride.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/block/paride/pg.c linux/drivers/block/paride/pg.c
@@ -171,6 +171,7 @@
 #include <linux/mtio.h>
 #include <linux/pg.h>
 #include <linux/wait.h>
+#include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
 
@@ -604,10 +605,12 @@
 	if ((unit >= PG_UNITS) || (PG.access <= 0)) 
 		return -EINVAL;
 
+	lock_kernel();
 	PG.access--;
 
 	kfree(PG.bufptr);
 	PG.bufptr = 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)