qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it
@ 2014-12-16 20:58 Chen Gang
  2015-01-07 16:01 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Gang @ 2014-12-16 20:58 UTC (permalink / raw)
  To: qemu-devel, QEMU Trivial

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>
---
 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;
 }
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-07 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16 20:58 [Qemu-devel] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it Chen Gang
2015-01-07 16:01 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).