From nobody Sun Feb 8 20:23:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1605541332; cv=none; d=zohomail.com; s=zohoarc; b=ItS/bQWs00b0XH1NaRJqBniuViHb2pzWUSptFtPSC669G0JyfFboBx+hFm3NWCPfcCtNmtneJGaYjhcVOSza+ehCXeq3W16yMmeaYWTTHnohyLFokDSOUVeblcFwVt+Qrj1vKcpinFhdYAUi9qSQULTUFHvcWrZd8lWCTgscKvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605541332; 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; bh=CwUe3c6giw2BnLymd6X7rohqHh9JqSynYNZvAmvD8SU=; b=FyVaChS7sevhboQXZZACaEaLGwoi2kEaiJG7wUy3WcyGbmouFnosEKn81BxjU+iGeIlIBmhf4yJUKEiWaCf4Dp3vtIzhfO2F09gOFphEu215fVQY3DFLWmdAESKEMveYC5SBvGyZNWe5OIgsrO9rQXPUMVynRc5r0PbFrORnSCI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605541332687495.2721946464361; Mon, 16 Nov 2020 07:42:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-592-WZmlX5RpOyiRbK-EnSFcbQ-1; Mon, 16 Nov 2020 10:39:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1483F195D561; Mon, 16 Nov 2020 15:39:48 +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 E4EFA1002D73; Mon, 16 Nov 2020 15:39:47 +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 B206258128; Mon, 16 Nov 2020 15:39:47 +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 0AGFdAW6022594 for ; Mon, 16 Nov 2020 10:39:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2D4316EF55; Mon, 16 Nov 2020 15:39:10 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E7F46EF51 for ; Mon, 16 Nov 2020 15:39:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605541331; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CwUe3c6giw2BnLymd6X7rohqHh9JqSynYNZvAmvD8SU=; b=QGFfsVIvezIYvynzyuhx2xRMSU1XOoqbi4PE5m/GtxB/nwAkYK+eID1rMQmv/YzRTaucX/ 3ZuKTgLxB4TNj/7OytDjfEcEbOve/EZt4wBgdqzC8l820q08uGnq36+qKaf7gqvFwdl3kN nmRsifYYJxUAlSzfj9FofhcuNQ2DfIk= X-MC-Unique: WZmlX5RpOyiRbK-EnSFcbQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 08/11] remote_driver: remove unreachable cleanup code Date: Mon, 16 Nov 2020 16:38:55 +0100 Message-Id: <501369d481f785b23b2da8e35c9187f1de5eca21.1605541084.git.phrdina@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 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In the cleanup section @info_ret will always be NULL. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/remote/remote_driver.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 9cd2fd36ae..dd5e8eeed2 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -2248,7 +2248,6 @@ remoteDomainGetIOThreadInfo(virDomainPtr dom, remote_domain_get_iothread_info_args args; remote_domain_get_iothread_info_ret ret; remote_domain_iothread_info *src; - virDomainIOThreadInfoPtr *info_ret =3D NULL; =20 remoteDriverLock(priv); =20 @@ -2273,6 +2272,8 @@ remoteDomainGetIOThreadInfo(virDomainPtr dom, } =20 if (info) { + virDomainIOThreadInfoPtr *info_ret =3D NULL; + if (!ret.info.info_len) { *info =3D NULL; rv =3D ret.ret; @@ -2293,17 +2294,11 @@ remoteDomainGetIOThreadInfo(virDomainPtr dom, info_ret[i]->cpumaplen =3D src->cpumap.cpumap_len; } *info =3D info_ret; - info_ret =3D NULL; } =20 rv =3D ret.ret; =20 cleanup: - if (info_ret) { - for (i =3D 0; i < ret.info.info_len; i++) - virDomainIOThreadInfoFree(info_ret[i]); - VIR_FREE(info_ret); - } xdr_free((xdrproc_t)xdr_remote_domain_get_iothread_info_ret, (char *) &ret); =20 @@ -7638,7 +7633,6 @@ remoteDomainGetFSInfo(virDomainPtr dom, remote_domain_get_fsinfo_args args; remote_domain_get_fsinfo_ret ret; remote_domain_fsinfo *src; - virDomainFSInfoPtr *info_ret =3D NULL; =20 remoteDriverLock(priv); =20 @@ -7661,6 +7655,8 @@ remoteDomainGetFSInfo(virDomainPtr dom, } =20 if (info) { + virDomainFSInfoPtr *info_ret =3D NULL; + if (!ret.info.info_len) { *info =3D NULL; rv =3D ret.ret; @@ -7690,17 +7686,11 @@ remoteDomainGetFSInfo(virDomainPtr dom, } =20 *info =3D info_ret; - info_ret =3D NULL; } =20 rv =3D ret.ret; =20 cleanup: - if (info_ret) { - for (i =3D 0; i < ret.info.info_len; i++) - virDomainFSInfoFree(info_ret[i]); - VIR_FREE(info_ret); - } xdr_free((xdrproc_t)xdr_remote_domain_get_fsinfo_ret, (char *) &ret); =20 --=20 2.26.2