From nobody Sun Dec 22 08:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1732807681995300.9224831143579; Thu, 28 Nov 2024 07:28:01 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 65A9610B; Thu, 28 Nov 2024 10:28:01 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id BF7061D43; Thu, 28 Nov 2024 10:27:23 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 31EB31C1C; Thu, 28 Nov 2024 10:22:57 -0500 (EST) Received: from air.basealt.ru (air.basealt.ru [193.43.8.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 93F4B17D8 for ; Thu, 28 Nov 2024 10:22:56 -0500 (EST) Received: from kuznetsovam-nb.office.basealt.ru (unknown [193.43.10.250]) by air.basealt.ru (Postfix) with ESMTPSA id 6489F23418; Thu, 28 Nov 2024 18:22:55 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 From: Alexander Kuznetsov To: devel@lists.libvirt.org Subject: [PATCH v2 1/6] access: Change return type of virAccessDriverStackAppend to void Date: Thu, 28 Nov 2024 18:21:17 +0300 Message-ID: <20241128152222.50660-2-kuznetsovam@altlinux.org> X-Mailer: git-send-email 2.42.2 In-Reply-To: <20241128152222.50660-1-kuznetsovam@altlinux.org> References: <20241128152222.50660-1-kuznetsovam@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: kuznetsovam@altlinux.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: Y5VRAWQ6SV52Z6QAESVUZDLUXPHM34GI X-Message-ID-Hash: Y5VRAWQ6SV52Z6QAESVUZDLUXPHM34GI X-Mailman-Approved-At: Thu, 28 Nov 2024 15:27:19 -0500 CC: nickel@altlinux.org, egori@altlinux.org, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZM-MESSAGEID: 1732807683467019100 Content-Type: text/plain; charset="utf-8" This function return value is invariant since VIR_EXPAND_N check removal in 7d2fd6e, so change its type and remove all dependent checks. Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Pavel Nekrasov Signed-off-by: Alexander Kuznetsov Reviewed-by: Jiri Denemark --- src/access/viraccessdriverstack.c | 4 +--- src/access/viraccessdriverstack.h | 2 +- src/access/viraccessmanager.c | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/access/viraccessdriverstack.c b/src/access/viraccessdriver= stack.c index fb9ea71665..9d6a0d4d1b 100644 --- a/src/access/viraccessdriverstack.c +++ b/src/access/viraccessdriverstack.c @@ -32,7 +32,7 @@ struct _virAccessDriverStackPrivate { }; =20 =20 -int virAccessDriverStackAppend(virAccessManager *manager, +void virAccessDriverStackAppend(virAccessManager *manager, virAccessManager *child) { virAccessDriverStackPrivate *priv =3D virAccessManagerGetPrivateData(m= anager); @@ -40,8 +40,6 @@ int virAccessDriverStackAppend(virAccessManager *manager, VIR_EXPAND_N(priv->managers, priv->managersLen, 1); =20 priv->managers[priv->managersLen-1] =3D child; - - return 0; } =20 =20 diff --git a/src/access/viraccessdriverstack.h b/src/access/viraccessdriver= stack.h index abcfc30ec3..f878ef1989 100644 --- a/src/access/viraccessdriverstack.h +++ b/src/access/viraccessdriverstack.h @@ -23,7 +23,7 @@ #include "access/viraccessdriver.h" =20 =20 -int virAccessDriverStackAppend(virAccessManager *manager, +void virAccessDriverStackAppend(virAccessManager *manager, virAccessManager *child); =20 extern virAccessDriver accessDriverStack; diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c index 481528c3b9..6d9fdee5f1 100644 --- a/src/access/viraccessmanager.c +++ b/src/access/viraccessmanager.c @@ -164,10 +164,7 @@ virAccessManager *virAccessManagerNewStack(const char = **names) if (!child) goto error; =20 - if (virAccessDriverStackAppend(manager, child) < 0) { - virObjectUnref(child); - goto error; - } + virAccessDriverStackAppend(manager, child); } =20 return manager; --=20 2.42.2