2
0
Эх сурвалжийг харах

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.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Chen Gang 10 жил өмнө
parent
commit
a39d97c7be
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      hw/net/xen_nic.c

+ 1 - 0
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;
 }