提交 1ba8d984 编写于 作者: M Marek Vasut 提交者: Tom Rini

net: rtl8139: Switch from malloc()+memset() to calloc()

Replace malloc()+memset() combination with calloc(), no functional change.
Signed-off-by: NMarek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
上级 9962dd25
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册