@@ -153,11 +153,11 @@ static void ioh3420_exitfn(PCIDevice *d)
PCIEPort *p = DO_UPCAST(PCIEPort, br, br);
PCIESlot *s = DO_UPCAST(PCIESlot, port, p);
- pcie_aer_exit(d);
pcie_chassis_del_slot(s);
pcie_cap_exit(d);
msi_uninit(d);
pci_bridge_exitfn(d);
+ pcie_aer_free(d);
pci_bridge_free(d);
}
@@ -118,11 +118,11 @@ static void xio3130_downstream_exitfn(PCIDevice *d)
PCIEPort *p = DO_UPCAST(PCIEPort, br, br);
PCIESlot *s = DO_UPCAST(PCIESlot, port, p);
- pcie_aer_exit(d);
pcie_chassis_del_slot(s);
pcie_cap_exit(d);
msi_uninit(d);
pci_bridge_exitfn(d);
+ pcie_aer_free(d);
pci_bridge_free(d);
}
@@ -101,10 +101,10 @@ err_bridge:
static void xio3130_upstream_exitfn(PCIDevice *d)
{
- pcie_aer_exit(d);
pcie_cap_exit(d);
msi_uninit(d);
pci_bridge_exitfn(d);
+ pcie_aer_free(d);
pci_bridge_free(d);
}
@@ -163,9 +163,10 @@ int pcie_aer_init(PCIDevice *dev, uint16_t offset)
return 0;
}
-void pcie_aer_exit(PCIDevice *dev)
+void pcie_aer_free(PCIDevice *dev)
{
g_free(dev->exp.aer_log.log);
+ dev->exp.aer_log.log = NULL;
}
static void pcie_aer_update_uncor_status(PCIDevice *dev)
@@ -88,7 +88,7 @@ struct PCIEAERErr {
extern const VMStateDescription vmstate_pcie_aer_log;
int pcie_aer_init(PCIDevice *dev, uint16_t offset);
-void pcie_aer_exit(PCIDevice *dev);
+void pcie_aer_free(PCIDevice *dev);
void pcie_aer_write_config(PCIDevice *dev,
uint32_t addr, uint32_t val, int len);
Rename it, and move its call towards the end to prepare for unrealize/instance_finalize split. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- hw/pci-bridge/ioh3420.c | 2 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-bridge/xio3130_upstream.c | 2 +- hw/pci/pcie_aer.c | 3 ++- include/hw/pci/pcie_aer.h | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-)