Skip to contentSkip to conversation

hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it

PATCH Applied Chen Gang 2 participants 2 messages Dec 16, 2014 – Jan 7, 2015

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it

Since net_init() checks whether 'netdev->mac' is NULL, before alloc it; net_release() also need set 'netdev->mac' to NULL after free it.

---
 hw/net/xen_nic.c | 1 +
 1 file changed, 1 insertion(+)
hw/net/xen_nic.c +1 -0
index 8eaa77b..19ecfc4 100644
@@ -428,6 +428,7 @@ static int net_free(struct XenDevice *xendev)
         netdev->nic = NULL;
     }
     g_free(netdev->mac);
+    netdev->mac = NULL;
     return 0;
 }
 
Signature · 1 line
1.9.3