]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/uli526x.c
net: uli526x: Add initialized eth_device structure
[karo-tx-uboot.git] / drivers / net / uli526x.c
index d626d68cb097c278b403c772ffcd45213e9fdc1d..a4624e1734df9977fe210eb57e13dcf7a6698ad8 100644 (file)
@@ -225,6 +225,11 @@ int uli526x_initialize(bd_t *bis)
                iobase &= ~0xf;
 
                dev = (struct eth_device *)malloc(sizeof *dev);
+               if (!dev) {
+                       printf("uli526x: Can not allocate memory\n");
+                       break;
+               }
+               memset(dev, 0, sizeof(*dev));
                sprintf(dev->name, "uli526x#%d", card_number);
                db = (struct uli526x_board_info *)
                        malloc(sizeof(struct uli526x_board_info));