]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/eepro100.c
Merge branch 'master' of git://git.denx.de/u-boot-samsung
[karo-tx-uboot.git] / drivers / net / eepro100.c
index 5cb767a795fa0ac132ca8ea770d33a0205877309..ae0e0d458209c4406fee32a3a0e50b29a57171e2 100644 (file)
@@ -321,7 +321,8 @@ static int set_phyreg (struct eth_device *dev, unsigned char addr,
 /* Check if given phyaddr is valid, i.e. there is a PHY connected.
  * Do this by checking model value field from ID2 register.
  */
-static struct eth_device* verify_phyaddr (char *devname, unsigned char addr)
+static struct eth_device* verify_phyaddr (const char *devname,
+                                               unsigned char addr)
 {
        struct eth_device *dev;
        unsigned short value;
@@ -449,6 +450,11 @@ int eepro100_initialize (bd_t * bis)
                }
 
                dev = (struct eth_device *) malloc (sizeof *dev);
+               if (!dev) {
+                       printf("eepro100: Can not allocate memory\n");
+                       break;
+               }
+               memset(dev, 0, sizeof(*dev));
 
                sprintf (dev->name, "i82559#%d", card_number);
                dev->priv = (void *) devno; /* this have to come before bus_to_phys() */