]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it
authorChen Gang <gang.chen.5i5j@gmail.com>
Tue, 16 Dec 2014 20:58:42 +0000 (04:58 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 12 Jan 2015 10:16:23 +0000 (10:16 +0000)
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>
hw/net/xen_nic.c

index 8eaa77b62d30f0a730ed34c32122f75bdc15ceef..19ecfc4ccf9b862d21c02d017761ab35a6ff3d58 100644 (file)
@@ -428,6 +428,7 @@ static int net_free(struct XenDevice *xendev)
         netdev->nic = NULL;
     }
     g_free(netdev->mac);
+    netdev->mac = NULL;
     return 0;
 }