From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpoV-0007Hn-Qn for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGpoN-0006WI-B2 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:31 -0400 Received: from mail-ee0-x229.google.com ([2a00:1450:4013:c00::229]:57581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpoN-0006Vz-4X for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:23 -0400 Received: by mail-ee0-f41.google.com with SMTP id d17so2980549eek.0 for ; Tue, 03 Sep 2013 05:34:22 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 3 Sep 2013 14:33:16 +0200 Message-Id: <1378211609-16121-26-git-send-email-pbonzini@redhat.com> In-Reply-To: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> References: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 25/38] pcie_aer: pcie_aer_exit really frees stuff List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Rename it to pcie_aer_free, and move it together with other freeing functions. Signed-off-by: Paolo Bonzini --- 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(-) diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index 16f0cf8..cadf103 100644 --- a/hw/pci-bridge/ioh3420.c +++ b/hw/pci-bridge/ioh3420.c @@ -150,11 +150,11 @@ static void ioh3420_exitfn(PCIDevice *d) { PCIESlot *s = PCIE_SLOT(d); - 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); } diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c index a0ac179..75522c6 100644 --- a/hw/pci-bridge/xio3130_downstream.c +++ b/hw/pci-bridge/xio3130_downstream.c @@ -115,11 +115,11 @@ static void xio3130_downstream_exitfn(PCIDevice *d) { PCIESlot *s = PCIE_SLOT(d); - 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); } diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c index 682a7e5..5cfdbc7 100644 --- a/hw/pci-bridge/xio3130_upstream.c +++ b/hw/pci-bridge/xio3130_upstream.c @@ -100,10 +100,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); } diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c index ca762ab..509f77e 100644 --- a/hw/pci/pcie_aer.c +++ b/hw/pci/pcie_aer.c @@ -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) diff --git a/include/hw/pci/pcie_aer.h b/include/hw/pci/pcie_aer.h index bcac80a..af1dec3 100644 --- a/include/hw/pci/pcie_aer.h +++ b/include/hw/pci/pcie_aer.h @@ -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); -- 1.8.3.1