net: eepro100: Switch from malloc()+memset() to calloc()
Replace malloc()+memset() combination with calloc(), no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
This commit is contained in:
parent
3a15684dc6
commit
6c7d3f6b3f
@ -746,12 +746,11 @@ int eepro100_initialize(bd_t *bis)
|
||||
continue;
|
||||
}
|
||||
|
||||
dev = (struct eth_device *)malloc(sizeof(*dev));
|
||||
dev = calloc(1, 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() */
|
||||
|
Loading…
Reference in New Issue
Block a user