From: Paolo Bonzini Date: Wed, 20 Aug 2014 15:50:05 +0000 (+0200) Subject: pci_bridge: manually destroy memory regions within PCIBridgeWindows X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9f6b2f1c6497adcce4dec9b3bd1f1e78877a03dd;p=qemu.git pci_bridge: manually destroy memory regions within PCIBridgeWindows The regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed. Reported-by: Gonglei Reported-by: Knut Omang Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index 13072655f5..40c97b155c 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w) static void pci_bridge_region_cleanup(PCIBridge *br, PCIBridgeWindows *w) { + object_unparent(OBJECT(&w->alias_io)); + object_unparent(OBJECT(&w->alias_mem)); + object_unparent(OBJECT(&w->alias_pref_mem)); + object_unparent(OBJECT(&w->alias_vga[QEMU_PCI_VGA_IO_LO])); + object_unparent(OBJECT(&w->alias_vga[QEMU_PCI_VGA_IO_HI])); + object_unparent(OBJECT(&w->alias_vga[QEMU_PCI_VGA_MEM])); g_free(w); }