From patchwork Tue Sep 3 12:33:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 272227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EBE7F2C00A4 for ; Tue, 3 Sep 2013 22:49:17 +1000 (EST) Received: from localhost ([::1]:45622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGq2l-0000Ab-Sh for incoming@patchwork.ozlabs.org; Tue, 03 Sep 2013 08:49:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpoZ-0007Op-Dd for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGpoQ-0006XL-SP for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:35 -0400 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:54861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpoQ-0006X4-LW for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:26 -0400 Received: by mail-ee0-f50.google.com with SMTP id d51so2969808eek.37 for ; Tue, 03 Sep 2013 05:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/IhKMZVR2kyWgToae3XVgHQDM9uobdvgsY+IUGMErvg=; b=pwLvvpLS7mRk0Hm9rvgxIVmjxR15VpiNjMrzSxhjGAsew0ZkSJoWckrdt3BB8mFz76 C5nIJB1z55/H/zJg50UoTNLS/9TbDfmKxVWtW9UdYqCXh+39xuV+pvrkJzYQrZ4NbA2L xKVn8HU4UBnYtEfcRuhvI5sSRMSSfBmv8ryPHhPGBAKyOkj5U1ZnBWhSIDaxMqNU3UJe ZsxJ4XCGWGzfisKv28+0kpSJXEAq6MfDBckqpmZZ02T7T8YNoOzDE4dq6pK4ko3dnTIY oJFmYddqhuSRWFMyrq5IgKSzm8oPi8u5ahdjcp3cMd94Z9jMXG04x3UB3czqFEOOwHaQ 3egA== X-Received: by 10.15.73.134 with SMTP id h6mr2217668eey.76.1378211665878; Tue, 03 Sep 2013 05:34:25 -0700 (PDT) Received: from playground.lan (net-37-117-144-28.cust.dsl.vodafone.it. [37.117.144.28]) by mx.google.com with ESMTPSA id f49sm31150419eec.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Sep 2013 05:34:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Sep 2013 14:33:18 +0200 Message-Id: <1378211609-16121-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> References: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::232 Cc: mst@redhat.com Subject: [Qemu-devel] [PATCH 27/38] ioh4320: reclaim memory in instance_finalize instead of exit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini --- hw/pci-bridge/ioh3420.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index cadf103..34bb5cd 100644 --- a/hw/pci-bridge/ioh3420.c +++ b/hw/pci-bridge/ioh3420.c @@ -154,6 +154,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); } @@ -219,6 +225,7 @@ static const TypeInfo ioh3420_info = { .name = "ioh3420", .parent = TYPE_PCIE_SLOT, .class_init = ioh3420_class_init, + .instance_finalize = ioh3420_instance_finalize, }; static void ioh3420_register_types(void)