patch-2.4.0-test4 linux/drivers/net/ppp_generic.c

Next file: linux/drivers/net/ptifddi.c
Previous file: linux/drivers/net/pcmcia/xirc2ps_cs.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/net/ppp_generic.c linux/drivers/net/ppp_generic.c
@@ -41,6 +41,7 @@
 #include <linux/ip.h>
 #include <linux/tcp.h>
 #include <linux/spinlock.h>
+#include <linux/smp_lock.h>
 #include <net/slhc_vj.h>
 #include <asm/atomic.h>
 
@@ -319,6 +320,7 @@
 {
 	struct ppp_file *pf = (struct ppp_file *) file->private_data;
 
+	lock_kernel();
 	if (pf != 0) {
 		file->private_data = 0;
 		if (atomic_dec_and_test(&pf->refcnt)) {
@@ -332,6 +334,7 @@
 			}
 		}
 	}
+	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)