All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it
@ 2014-12-16 20:58 ` Chen Gang
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

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

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.