From a39d97c7becca5fd679d70d17ae5b1d62b9b5da6 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Wed, 17 Dec 2014 04:58:42 +0800 Subject: 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 --- hw/net/xen_nic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/net') diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 8eaa77b..19ecfc4 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; } -- cgit v1.1