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

Next file: linux/drivers/net/olympic.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.2.10/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -107,6 +107,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);
@@ -225,6 +227,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);
@@ -551,6 +555,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)