patch-1.3.70 linux/drivers/net/slip.c

Next file: linux/drivers/net/smc-ultra.c
Previous file: linux/drivers/net/skeleton.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.69/linux/drivers/net/slip.c linux/drivers/net/slip.c
@@ -1335,12 +1335,17 @@
 	{
 		for (i = 0; i < slip_maxdev; i++)  
 		{
-			if (slip_ctrls[i]->dev.start)
-			/* VSV = if dev->start==0, then device
-			unregistred while close proc. */ 
+			if (slip_ctrls[i])
 			{
-				unregister_netdev(&(slip_ctrls[i]->dev));
+				/*
+				 * VSV = if dev->start==0, then device
+				 * unregistred while close proc.
+				 */ 
+				if (slip_ctrls[i]->dev.start)
+					unregister_netdev(&(slip_ctrls[i]->dev));
+
 				kfree(slip_ctrls[i]);
+				slip_ctrls[i] = NULL;
 			}
 		}
 		kfree(slip_ctrls);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this