]> git.proxmox.com Git - mirror_qemu.git/commitdiff
pci: fix double free of romfile property
authorAnthony Liguori <aliguori@us.ibm.com>
Thu, 15 Mar 2012 16:29:56 +0000 (11:29 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 16 Mar 2012 18:17:06 +0000 (13:17 -0500)
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

index bf046bfcad7beb734a5f584cdad07633e8c87789..ed8ec990735896400d80df7c1fe8b7970a5ac93c 100644 (file)
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -841,7 +841,6 @@ static int pci_unregister_device(DeviceState *dev)
 
     pci_unregister_io_regions(pci_dev);
     pci_del_option_rom(pci_dev);
-    g_free(pci_dev->romfile);
     do_pci_unregister_device(pci_dev);
     return 0;
 }