提交 28ae02e5 编写于 作者: M Michal Simek

net: emaclite: Use calloc instead of malloc

Simplify driver logic and clear eth_device structure
in one command.
Signed-off-by: NMichal Simek <monstr@monstr.eu>
上级 be986967
......@@ -344,11 +344,10 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
{
struct eth_device *dev;
dev = malloc(sizeof(*dev));
dev = calloc(1, sizeof(*dev));
if (dev == NULL)
return -1;
memset(dev, 0, sizeof(*dev));
sprintf(dev->name, "Xelite.%x", base_addr);
dev->iobase = base_addr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册