From nobody Fri Apr 19 14:58:58 2024 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=1605878059; cv=none; d=zohomail.com; s=zohoarc; b=OD4SqQXcuqQqC/A2L3wEwWfVdq4IG2D29HzSi5YpUxq986sEkg7U07mBtvl3jWA3X98ZmXZnlbcbhBk9aydO8AitBk1t5ltXqDXYzheInTfbLrMXX5lTCpG6NNGLzMKzSAaZhU8hqxKxpq5u/GaGPeZ1rnUQEFxMq/XbSzTPHxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605878059; 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=kQPFpi/V/3jj8SJowasy890g9CMlg4pfw68pdDptAC8=; b=BzK7IdMmEsZwJELWU+CsYemkgQx4L2tCr0BYl7T4nuKKU+1podClhQETHi5KoEpz841QmEwYQgFemEQ7nz/CkjDLD2/IUapXTM/4DO309oLW19wHfpjvb61Tge+EinjHj+JjLSRKQpRGqCnQe/YQ6ZXvoW4zsIZjycD1RMl08J8= 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 1605878059376538.6108152473522; Fri, 20 Nov 2020 05:14:19 -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-383-gVlG7h0-M4ivf6eQufFShg-1; Fri, 20 Nov 2020 08:14:15 -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 8FB19814411; Fri, 20 Nov 2020 13:14:09 +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 274EA10016F4; Fri, 20 Nov 2020 13:14:09 +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 AA8771809CA0; Fri, 20 Nov 2020 13:14:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AKDE5Wi026332 for ; Fri, 20 Nov 2020 08:14:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6C3C310021AA; Fri, 20 Nov 2020 13:14:05 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E88D110016F4 for ; Fri, 20 Nov 2020 13:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605878058; 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=kQPFpi/V/3jj8SJowasy890g9CMlg4pfw68pdDptAC8=; b=F23lhFEOuhZqZh4KXX8h3VWbaRF4T7YqNi5Q5XF15IZWigTag86KnAMP0xqMmzd0JUNnM3 wobdaKrxqddwfI+RGshaTeP7MhcvRuY9gkrcicfQOvfN6VOTBAU/cxziixMj9l+iKURPhb 1xCvmdq9uwJNXfk2ziXFRwW0KimMEow= X-MC-Unique: gVlG7h0-M4ivf6eQufFShg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] udevConnectListAllInterfaces: initialize ret Date: Fri, 20 Nov 2020 14:13:58 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Currently, ret is only used in the 'cleanup' section and initialized right before the jump. Switch to the customary initialization to -1 and only leave in the 'ret =3D 0' statement on an empty list. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/interface/interface_backend_udev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index ce007fd29e..31246dde74 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -303,7 +303,7 @@ udevConnectListAllInterfaces(virConnectPtr conn, int tmp_count; int count =3D 0; int status =3D 0; - int ret; + int ret =3D -1; =20 virCheckFlags(VIR_CONNECT_LIST_INTERFACES_FILTERS_ACTIVE, -1); =20 @@ -320,7 +320,6 @@ udevConnectListAllInterfaces(virConnectPtr conn, virReportError(VIR_ERR_INTERNAL_ERROR, _("failed to get list of %s interfaces on host"), virUdevStatusString(status)); - ret =3D -1; goto cleanup; } =20 --=20 2.26.2 From nobody Fri Apr 19 14:58:58 2024 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=1605878068; cv=none; d=zohomail.com; s=zohoarc; b=f3TwkD0tJy/EXzbYXaiBA5SV0OF719zonkiJyCI9wPFe7jwEVQnOdER8rhzY9x6C9t5bMxQRlB5T+5QnpF2GRf2guEQ2KCEj4wuYJV+SFi24XGSeos+w5NHvLfdOQD5x5LbaSJmW+sa6qo12KO16f8XNkpvoyaneKKPpki1vmAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605878068; 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=VBKaWxJeRuCjlZffwNZun7KDVS604P0u/TEKCkhwR/U=; b=dvayeJ8J3yhFUxVix1zwKGRGjNZ8R5oKtNkAS/CK4e9FIciF8n4daXKcfZHBEYQXRVqpDX9P2Ac5R17D5jn8FyQiZzE5vqYnD3srF2eFBOMKkAsl3AGg0A9p0726D1kSDc49yfFlesXSd+jnZB6SBDmiO93qlWwCFItaFrhm8QQ= 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 1605878068619478.82275722481063; Fri, 20 Nov 2020 05:14:28 -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-573-hD5RO5j0PbS6gLb1uaANWQ-1; Fri, 20 Nov 2020 08:14:24 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F217C100C605; Fri, 20 Nov 2020 13:14:16 +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 D02B460C05; Fri, 20 Nov 2020 13:14:16 +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 9923F46F59; Fri, 20 Nov 2020 13:14:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AKDE6ri026338 for ; Fri, 20 Nov 2020 08:14:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3EB671002391; Fri, 20 Nov 2020 13:14:06 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB15110021AA for ; Fri, 20 Nov 2020 13:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605878066; 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=VBKaWxJeRuCjlZffwNZun7KDVS604P0u/TEKCkhwR/U=; b=ZcGOgVx0P+T0dbp7kVQXLnkR5mnaoFqUG+DDbRNhAfJi4lJlziNUhnE77ux/j1Pc6XxKyy EFptppCnTP2QTuU1+qnESD/LcqfYwzIwjREFWKzQq8kGEkcXQ86Is6TLf3mrcA6ZE19WV8 /wAyE29fHiDdlkiOj9vBmP4Ffc6c6wo= X-MC-Unique: hD5RO5j0PbS6gLb1uaANWQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] udevConnectListAllInterfaces: delete pointless cleanup code Date: Fri, 20 Nov 2020 14:13:59 +0100 Message-Id: <6da60f0f12e3c521774eadc8a9aa6fe462a39e61.1605878022.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.79 on 10.5.11.12 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We only jump to cleanup before allocating any lists. Drop the dead code. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/interface/interface_backend_udev.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index 31246dde74..351584ddf3 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -405,14 +405,6 @@ udevConnectListAllInterfaces(virConnectPtr conn, if (enumerate) udev_enumerate_unref(enumerate); udev_unref(udev); - - if (ifaces) { - for (tmp_count =3D 0; tmp_count < count; tmp_count++) - virObjectUnref(ifaces_list[tmp_count]); - } - - VIR_FREE(ifaces_list); - return ret; =20 } --=20 2.26.2