zeroing a structure before using it is more common than zeroing after
using it. Also makes the setting of nd->used more obvious.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
goto out;
}
nd = &nd_table[idx];
+ memset(nd, 0, sizeof(*nd));
macaddr = nd->macaddr;
macaddr[0] = 0x52;
macaddr[1] = 0x54;
qemu_free(nd->devaddr);
qemu_free(nd->id);
- memset(nd, 0, sizeof(*nd));
+ nd->used = 0;
}
static int net_host_check_device(const char *device)