aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-08-20 17:50:05 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-08-25 00:16:06 +0200
commit9f6b2f1c6497adcce4dec9b3bd1f1e78877a03dd (patch)
tree157eeeecaf5a89ad64d13024819fa65dfbcba1c1 /hw
parent288d3322022d6ad646407f3ca6f1a6a746565b9a (diff)
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 <arei.gonglei@huawei.com> Reported-by: Knut Omang <knut.omang@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci/pci_bridge.c6
1 files changed, 6 insertions, 0 deletions
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);
}