aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2014-12-17 04:58:42 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2015-01-12 10:16:23 +0000
commita39d97c7becca5fd679d70d17ae5b1d62b9b5da6 (patch)
tree78168867f05c4403eb5b94f149f93d97e419fd8e /hw
parentd46858377b822b820946c6b2e3a9153ee0aebd37 (diff)
downloadqemu-a39d97c7becca5fd679d70d17ae5b1d62b9b5da6.zip
qemu-a39d97c7becca5fd679d70d17ae5b1d62b9b5da6.tar.gz
qemu-a39d97c7becca5fd679d70d17ae5b1d62b9b5da6.tar.bz2
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 <gang.chen.5i5j@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/xen_nic.c1
1 files changed, 1 insertions, 0 deletions
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;
}