From nobody Wed Nov 27 12:33:40 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548258339906802.7856618381045; Wed, 23 Jan 2019 07:45:39 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8F5CA85F; Wed, 23 Jan 2019 15:45:37 +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 50D0517DEE; Wed, 23 Jan 2019 15:45:37 +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 C0318180339A; Wed, 23 Jan 2019 15:45:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0NFjZXP010037 for ; Wed, 23 Jan 2019 10:45:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 254D16607E; Wed, 23 Jan 2019 15:45:35 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E7286BF63 for ; Wed, 23 Jan 2019 15:45:34 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 23 Jan 2019 16:45:06 +0100 Message-Id: <8e18f2bd9fb218b2fcdb12d5165cc3cc53f0242b.1548258272.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] virPCIGetNetName: Initialize @netname to NULL 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 23 Jan 2019 15:45:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This is a return argument that is to be compared against NULL on successful return. However, it is not initialized and therefore relies on callers setting it to NULL prior calling the function. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/util/virnetdev.c | 2 -- src/util/virpci.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 92ef008ca1..f3e3d442ed 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1445,8 +1445,6 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, c= har **pfname, { int ret =3D -1; =20 - *pfname =3D NULL; - if (virNetDevGetPhysicalFunction(vfname, pfname) < 0) return -1; =20 diff --git a/src/util/virpci.c b/src/util/virpci.c index 537876bcba..ef578bf774 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2853,6 +2853,8 @@ virPCIGetNetName(const char *device_link_sysfs_path, struct dirent *entry =3D NULL; size_t i =3D 0; =20 + *netname =3D NULL; + if (virBuildPath(&pcidev_sysfs_net_path, device_link_sysfs_path, "net") =3D=3D -1) { virReportOOMError(); --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Nov 27 12:33:40 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548258340777911.4626398855117; Wed, 23 Jan 2019 07:45:40 -0800 (PST) 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 F072419CF24; Wed, 23 Jan 2019 15:45:37 +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 AF26A16719; Wed, 23 Jan 2019 15:45:37 +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 74C661803395; Wed, 23 Jan 2019 15:45:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0NFjZCg010045 for ; Wed, 23 Jan 2019 10:45:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id EF63A67E71; Wed, 23 Jan 2019 15:45:35 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75F076B8FB for ; Wed, 23 Jan 2019 15:45:35 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 23 Jan 2019 16:45:07 +0100 Message-Id: <53927b6632434493b999b2188f2b06e1f31eef4b.1548258272.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] virpci: Fix memleak in virPCIDeviceIterDevices 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.29]); Wed, 23 Jan 2019 15:45:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This partially reverts 00dc991ca167302c7a72f4fb16be061d05b12a32. 2,030 (1,456 direct, 574 indirect) bytes in 14 blocks are definitely lost = in loss record 77 of 80 at 0x4C30E96: calloc (vg_replace_malloc.c:711) by 0x50F83AA: virAlloc (viralloc.c:143) by 0x5178DFA: virPCIDeviceNew (virpci.c:1753) by 0x51753E9: virPCIDeviceIterDevices (virpci.c:468) by 0x5175EB5: virPCIDeviceGetParent (virpci.c:759) by 0x517AB55: virPCIDeviceIsBehindSwitchLackingACS (virpci.c:2476) by 0x517AC24: virPCIDeviceIsAssignable (virpci.c:2494) by 0x10BF27: testVirPCIDeviceIsAssignable (virpcitest.c:229) by 0x10D14C: virTestRun (testutils.c:174) by 0x10C535: mymain (virpcitest.c:422) by 0x10F1B6: virTestMain (testutils.c:1112) by 0x10CF93: main (virpcitest.c:455) Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/util/virpci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virpci.c b/src/util/virpci.c index ef578bf774..fb22460bf5 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -482,6 +482,8 @@ virPCIDeviceIterDevices(virPCIDeviceIterPredicate predi= cate, *matched =3D check; ret =3D 1; break; + } else { + virPCIDeviceFree(check); } } VIR_DIR_CLOSE(dir); --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Nov 27 12:33:40 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548258347140222.59444279250317; Wed, 23 Jan 2019 07:45:47 -0800 (PST) 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 E559673; Wed, 23 Jan 2019 15:45:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ABE0B19743; Wed, 23 Jan 2019 15:45:44 +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 4A3933F602; Wed, 23 Jan 2019 15:45:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0NFja1e010053 for ; Wed, 23 Jan 2019 10:45:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id CA17D6607E; Wed, 23 Jan 2019 15:45:36 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C0C06B8D6 for ; Wed, 23 Jan 2019 15:45:36 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 23 Jan 2019 16:45:08 +0100 Message-Id: <1ee9b341d604bc25ceedd5a6fb3b0821ff8cb14b.1548258272.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] domain_conf: Free egl render node in virDomainGraphicsDefFree 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.29]); Wed, 23 Jan 2019 15:45:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 13 bytes in 1 blocks are definitely lost in loss record 44 of 179 at 0x4C2EE6F: malloc (vg_replace_malloc.c:299) by 0x9514A69: strdup (in /lib64/libc-2.27.so) by 0x5E60C0B: virStrdup (virstring.c:956) by 0x54C856F: virHostGetDRMRenderNode (qemuxml2argvmock.c:190) by 0x57CB4E3: qemuProcessGraphicsSetupRenderNode (qemu_process.c:4860) by 0x57CB571: qemuProcessSetupGraphics (qemu_process.c:4881) by 0x57CE01B: qemuProcessPrepareDomain (qemu_process.c:6040) by 0x57D102E: qemuProcessCreatePretendCmd (qemu_process.c:6975) by 0x114C1C: testCompareXMLToArgv (qemuxml2argvtest.c:611) by 0x134B90: virTestRun (testutils.c:174) by 0x123478: mymain (qemuxml2argvtest.c:1697) by 0x136BFA: virTestMain (testutils.c:1112) Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/conf/domain_conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 54d6364f4f..f3d541bc12 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1423,6 +1423,9 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr= def) break; =20 case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: + VIR_FREE(def->data.egl_headless.rendernode); + break; + case VIR_DOMAIN_GRAPHICS_TYPE_LAST: break; } --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list