From nobody Sun Feb 8 21:29:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560863178; cv=none; d=zoho.com; s=zohoarc; b=b6Qbr3lisEpE2PrFJ37RUEmHzMgKjyh1sJ9/SXpvQ/eeLz9VRbWUZgaJcz6tQM5u1qrgKesTb6SGkhGVi3tgZjeN6a+wyhU6+DEl0/FpqrdCKeK2KPLta4TIPrtdPL+WplFXm2QmAkvqPds1RABW4US43+oHro0K/sUz0CSHTQE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560863178; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=bVufoM5zFNVbD5tZAuOkCdaNUYk0jpuN7Xx28YALELs=; b=bDDxdmfIZb87RWV8yWF8JKBIxTz3Gp1FT283cAZznEL1OfN7r7VJhN9O31deK4xxm+IeeZeIpenxZJc/Vf04isoz4O2XWku+3nEETwkmB43nSsuH+sqzmtgTrKiVJbWGnQn8NVN+N9UlMVLu79YVUj12JnLWbxerfvKhNHdGOYY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560863178788552.056891636775; Tue, 18 Jun 2019 06:06:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C95A559469; Tue, 18 Jun 2019 13:06:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E68D5F1B7; Tue, 18 Jun 2019 13:06:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 53F751806B18; Tue, 18 Jun 2019 13:06:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5ID4dBS017602 for ; Tue, 18 Jun 2019 09:04:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 003417DE37; Tue, 18 Jun 2019 13:04:39 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6558A7EA41 for ; Tue, 18 Jun 2019 13:04:34 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 15:04:21 +0200 Message-Id: <0d78560e05cdb77f70e1857030f8b0a2ce001049.1560862640.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] virHostdevGetPCIHostDeviceList: Use VIR_AUTOPTR for virPCIDevice X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 18 Jun 2019 13:06:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/util/virhostdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 9c63d0aebd..5935d926aa 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -227,7 +227,7 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *= hostdevs, int nhostdevs) for (i =3D 0; i < nhostdevs; i++) { virDomainHostdevDefPtr hostdev =3D hostdevs[i]; virDomainHostdevSubsysPCIPtr pcisrc =3D &hostdev->source.subsys.u.= pci; - virPCIDevicePtr pci; + VIR_AUTOPTR(virPCIDevice) pci =3D NULL; =20 if (hostdev->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) continue; @@ -251,10 +251,10 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr= *hostdevs, int nhostdevs) virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_KVM); =20 if (virPCIDeviceListAdd(pcidevs, pci) < 0) { - virPCIDeviceFree(pci); virObjectUnref(pcidevs); return NULL; } + pci =3D NULL; } =20 return pcidevs; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list