* [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
* Re: [Qemu-devel] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it
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
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2015-01-07 16:01 UTC (permalink / raw)
To: Chen Gang; +Cc: QEMU Trivial, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
On Wed, Dec 17, 2014 at 04:58:42AM +0800, Chen Gang wrote:
> 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(+)
Thanks, applied to my net tree:
https://github.com/stefanha/qemu/commits/net
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [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).