From: Marek Vasut Date: Sat, 9 May 2020 20:34:36 +0000 (+0200) Subject: net: rtl8139: Switch from malloc()+memset() to calloc() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=1ba8d9844562c74f0d80423d5dac658291d6d2f1;p=u-boot.git net: rtl8139: Switch from malloc()+memset() to calloc() Replace malloc()+memset() combination with calloc(), no functional change. Signed-off-by: Marek Vasut Cc: Joe Hershberger --- diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index cc7fcdfea4..4874c1aa4f 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -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);