patch-2.3.13 linux/drivers/net/net_init.c

Next file: linux/drivers/net/ni5010.c
Previous file: linux/drivers/net/ne2k-pci.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.12/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -111,6 +111,8 @@
 		alloc_size &= ~3;		/* Round to dword boundary. */
 
 		dev = (struct device *)kmalloc(alloc_size, GFP_KERNEL);
+		if(dev==NULL)
+			return NULL;
 		memset(dev, 0, alloc_size);
 		if (sizeof_priv)
 			dev->priv = (void *) (dev + 1);
@@ -233,6 +235,8 @@
 		alloc_size &= ~3;		/* Round to dword boundary. */
 
 		dev = (struct device *)kmalloc(alloc_size, GFP_KERNEL);
+		if(dev==NULL)
+			return NULL;
 		memset(dev, 0, alloc_size);
 		if (sizeof_priv)
 			dev->priv = (void *) (dev + 1);
@@ -563,6 +567,8 @@
 
 		alloc_size &= ~3;		/* Round to dword boundary. */
 		dev = (struct device *)kmalloc(alloc_size, GFP_KERNEL);
+		if(dev==NULL)
+			return NULL;
 		memset(dev, 0, alloc_size);
 		if (sizeof_priv)
 			dev->priv = (void *) (dev + 1);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)