]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: rtl8139: Switch from malloc()+memset() to calloc()
authorMarek Vasut <marek.vasut@gmail.com>
Sat, 9 May 2020 20:34:36 +0000 (22:34 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 12 Jun 2020 17:17:23 +0000 (13:17 -0400)
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>
drivers/net/rtl8139.c

index cc7fcdfea40c7e39a6bb0655255f448b1fb92378..4874c1aa4fffd4721212c53946265ec08c9c4704 100644 (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);