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

Next file: linux/drivers/net/pi2.c
Previous file: linux/drivers/net/ne.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.18/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -24,6 +24,7 @@
 #include <linux/fs.h>
 #include <linux/malloc.h>
 #include <linux/if_ether.h>
+#include <linux/if_arp.h>
 #include <linux/string.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -114,8 +115,10 @@
 							dev->priv = (void*) *mem_startp;
 							*mem_startp += sizeof_priv;
 						} else
-							dev->priv = kmalloc(sizeof_priv, GFP_KERNEL);
-						memset(dev->priv, 0, sizeof_priv);
+							dev->priv = sizeof_priv
+							  ? kmalloc(sizeof_priv, GFP_KERNEL)
+							  :	NULL;
+						if (dev->priv) memset(dev->priv, 0, sizeof_priv);
 						goto found;
 					}
 			}

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