pci: fix double free of romfile property

Message ID 1331828996-17164-1-git-send-email-aliguori@us.ibm.com
State New
Headers show

Commit Message

Anthony Liguori March 15, 2012, 4:29 p.m.
The qdev property release function frees any string properties.  This was
resulting in a double free during hot unplug.

It manifests in network devices because block devices have a NULL romfile
property by default.

Cc: Michael Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
 hw/pci.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/hw/pci.c b/hw/pci.c
index bf046bf..ed8ec99 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -841,7 +841,6 @@  static int pci_unregister_device(DeviceState *dev)
-    g_free(pci_dev->romfile);
     return 0;