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

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

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/block/paride/pt.c linux/drivers/block/paride/pt.c
@@ -149,6 +149,7 @@
 #include <linux/malloc.h>
 #include <linux/mtio.h>
 #include <linux/wait.h>
+#include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
 
@@ -773,6 +774,7 @@
         if ((unit >= PT_UNITS) || (PT.access <= 0)) 
                 return -EINVAL;
 
+	lock_kernel();
 	if (PT.flags & PT_WRITING) pt_write_fm(unit);
 
 	if (PT.flags & PT_REWIND) pt_rewind(unit);	
@@ -781,6 +783,7 @@
 
 	kfree(PT.bufptr);
 	PT.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)