From: Chen Gang Date: Tue, 16 Dec 2014 20:58:42 +0000 (+0800) Subject: hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a39d97c7becca5fd679d70d17ae5b1d62b9b5da6;p=qemu.git hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it Since net_init() checks whether 'netdev->mac' is NULL, before alloc it; net_release() also need set 'netdev->mac' to NULL after free it. Signed-off-by: Chen Gang Signed-off-by: Stefan Hajnoczi --- diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 8eaa77b62d..19ecfc4ccf 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -428,6 +428,7 @@ static int net_free(struct XenDevice *xendev) netdev->nic = NULL; } g_free(netdev->mac); + netdev->mac = NULL; return 0; }