From nobody Thu Nov 6 14:17:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542122893521619.8557436480908; Tue, 13 Nov 2018 07:28:13 -0800 (PST) Received: from localhost ([::1]:54459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMabs-0005qs-4L for importer@patchew.org; Tue, 13 Nov 2018 10:28:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMaZt-0004ID-3X for qemu-devel@nongnu.org; Tue, 13 Nov 2018 10:26:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMaME-0003PY-82 for qemu-devel@nongnu.org; Tue, 13 Nov 2018 10:12:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMaME-0003P3-1r for qemu-devel@nongnu.org; Tue, 13 Nov 2018 10:12:02 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1818D3082E51 for ; Tue, 13 Nov 2018 15:12:01 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC4165D759; Tue, 13 Nov 2018 15:11:48 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Tue, 13 Nov 2018 16:11:44 +0100 Message-Id: <1542121904-17330-1-git-send-email-thuth@redhat.com> In-Reply-To: <151f5fb1-98d4-5414-aad0-f6c7d704686a@redhat.com> References: <151f5fb1-98d4-5414-aad0-f6c7d704686a@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 13 Nov 2018 15:12:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] tests/ide: Free pcibus when finishing a test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Once a test has finished, the pcibus structure should be freed, to avoid leaking memory and to make sure that the structure is properly re-initialized when the next test starts. Signed-off-by: Thomas Huth Reviewed-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/ide-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index 33cef61..f0280e6 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -142,6 +142,10 @@ static void ide_test_start(const char *cmdline_fmt, ..= .) =20 static void ide_test_quit(void) { + if (pcibus) { + qpci_free_pc(pcibus); + pcibus =3D NULL; + } pc_alloc_uninit(guest_malloc); guest_malloc =3D NULL; qtest_end(); --=20 1.8.3.1