Patchwork [28/39] ioh4320: split exit and instance_finalize

login
register
mail settings
Submitter Paolo Bonzini
Date June 4, 2013, 6:52 p.m.
Message ID <1370371954-8479-29-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/248828/
State New
Headers show

Comments

Paolo Bonzini - June 4, 2013, 6:52 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/pci-bridge/ioh3420.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch

diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
index 0a3cbb7..50df259 100644
--- a/hw/pci-bridge/ioh3420.c
+++ b/hw/pci-bridge/ioh3420.c
@@ -157,6 +157,12 @@  static void ioh3420_exitfn(PCIDevice *d)
     pcie_cap_exit(d);
     msi_uninit(d);
     pci_bridge_exitfn(d);
+}
+
+static void ioh3420_instance_finalize(Object *obj)
+{
+    PCIDevice *d = PCI_DEVICE(obj);
+
     pcie_aer_free(d);
     pci_bridge_free(d);
 }
@@ -233,6 +239,7 @@  static const TypeInfo ioh3420_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIESlot),
     .class_init    = ioh3420_class_init,
+    .instance_finalize = ioh3420_instance_finalize,
 };
 
 static void ioh3420_register_types(void)