summary refs log tree commit diff stats
path: root/hw/pci_bridge_dev.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-06-18 10:18:44 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-06-18 10:18:44 -0500
commitdf6606f4556a752d30a4eab26c626b6c34717ea8 (patch)
tree095df894fd2f1e40f6a8a5a6393e10a953d8054d /hw/pci_bridge_dev.c
parent49023ff78cf1efeb861b475c40dd04262efe61d3 (diff)
parent80aa796bf38b7ef21daa42673b4711510c450d8a (diff)
downloadfocaccia-qemu-df6606f4556a752d30a4eab26c626b6c34717ea8.tar.gz
focaccia-qemu-df6606f4556a752d30a4eab26c626b6c34717ea8.zip
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
* mst/tags/for_anthony:
  pci_bridge_dev: fix error path in pci_bridge_dev_initfn()
  qdev: release parent properties on dc->init failure
  msi: Use msi/msix_present more consistently
  msi: Invoke msi/msix_write_config from PCI core
  msi: Guard msi/msix_write_config with msi_present
  msi: Invoke msi/msix_reset from PCI core
  msi: Guard msi_reset with msi_present
  ahci: Clean up reset functions
  intel-hda: Fix reset of MSI function
  ahci: Fix reset of MSI function
  rtl8139: honor RxOverflow flag in can_receive method
  shpc: unparent device before free
Diffstat (limited to 'hw/pci_bridge_dev.c')
-rw-r--r--hw/pci_bridge_dev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/pci_bridge_dev.c b/hw/pci_bridge_dev.c
index eccaa5831e..1cc1d2049c 100644
--- a/hw/pci_bridge_dev.c
+++ b/hw/pci_bridge_dev.c
@@ -52,7 +52,7 @@ static int pci_bridge_dev_initfn(PCIDevice *dev)
 {
     PCIBridge *br = DO_UPCAST(PCIBridge, dev, dev);
     PCIBridgeDev *bridge_dev = DO_UPCAST(PCIBridgeDev, bridge, br);
-    int err;
+    int err, ret;
     pci_bridge_map_irq(br, NULL, pci_bridge_dev_map_irq_fn);
     err = pci_bridge_initfn(dev);
     if (err) {
@@ -86,6 +86,8 @@ slotid_error:
     shpc_cleanup(dev, &bridge_dev->bar);
 shpc_error:
     memory_region_destroy(&bridge_dev->bar);
+    ret = pci_bridge_exitfn(dev);
+    assert(!ret);
 bridge_error:
     return err;
 }
@@ -119,10 +121,8 @@ static void pci_bridge_dev_write_config(PCIDevice *d,
 static void qdev_pci_bridge_dev_reset(DeviceState *qdev)
 {
     PCIDevice *dev = DO_UPCAST(PCIDevice, qdev, qdev);
+
     pci_bridge_reset(qdev);
-    if (msi_present(dev)) {
-        msi_reset(dev);
-    }
     shpc_reset(dev);
 }