[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 4/4] hw/net/xen_nic.c: Set 'netdev->mac' to NULL afte
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 4/4] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it |
Date: |
Mon, 12 Jan 2015 10:27:46 +0000 |
From: Chen Gang <address@hidden>
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 <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/net/xen_nic.c | 1 +
1 file changed, 1 insertion(+)
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;
}
--
2.1.0