[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after
From: |
Chen Gang |
Subject: |
[Qemu-trivial] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it |
Date: |
Wed, 17 Dec 2014 04:58:42 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
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>
---
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-trivial] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it,
Chen Gang <=