net: rtl8139: 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>
Cc: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
Marek Vasut
2020-05-09 22:34:36 +02:00
committed by Tom Rini
parent 9962dd25b1
commit 1ba8d98445

View File

@@ -554,12 +554,11 @@ int rtl8139_initialize(bd_t *bis)
debug("rtl8139: REALTEK RTL8139 @0x%x\n", iobase);
dev = (struct eth_device *)malloc(sizeof(*dev));
dev = calloc(1, sizeof(*dev));
if (!dev) {
printf("Can not allocate memory of rtl8139\n");
break;
}
memset(dev, 0, sizeof(*dev));
rtl8139_name(dev->name, card_number);