Message ID | 20200509203444.821733-2-marek.vasut+renesas@gmail.com |
---|---|
State | Accepted |
Commit | 1ba8d9844562c74f0d80423d5dac658291d6d2f1 |
Headers | show |
Series | [01/10] net: rtl8139: Factor out device name assignment | expand |
diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index adee618543..aabaacabc5 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -551,12 +551,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);
Replace malloc()+memset() combination with calloc(), no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com> Cc: Joe Hershberger <joe.hershberger at ni.com> --- drivers/net/rtl8139.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)