]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/pcnet.c
Merge branch 'master' of git://git.denx.de/u-boot-samsung
[karo-tx-uboot.git] / drivers / net / pcnet.c
index a4f02141063621588bd4ca837b5e7e36563091c6..e994cb690197f722f50ef03f6fd2c8c2035e11f0 100644 (file)
@@ -26,6 +26,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
@@ -186,6 +187,11 @@ int pcnet_initialize (bd_t * bis)
                 * Allocate and pre-fill the device structure.
                 */
                dev = (struct eth_device *) malloc (sizeof *dev);
+               if (!dev) {
+                       printf("pcnet: Can not allocate memory\n");
+                       break;
+               }
+               memset(dev, 0, sizeof(*dev));
                dev->priv = (void *) devbusfn;
                sprintf (dev->name, "pcnet#%d", dev_nr);