From nobody Sun Feb 8 19:56:55 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=1614183657; cv=none; d=zohomail.com; s=zohoarc; b=hKz1AjFn0xyCAvLFgVhh1O6UbGqEtsYxLCsLHQJK5eNT7UFiuOCoCPWqTNpUDD37JKxU3CfAGq0HjMf50p4iGtX2ARfWT22eS+2mNRz8tahIrLJxP6uKKmNdgJZgMFHW0Lk0dsnMOsRqqFe0ufWFaooShtN68cK6wDDyW16WNT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614183657; 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=OX37VHH8nMAXILwQuIv4/9nPzgPOlazKoLXR8RZfMg0=; b=N9cI9M9E+H8HsbJDVtoLx8NM8HXdAaVUBFbSyoRz34iYpOmXQKEZTdOabrbiQdEbE+cslNIo5aXUYwjljBEx0XlY90VHtagJNyX0yuG7fjt8uOX3mp0hGUdyJfUs0QIQphQOAwV16hg4hYc+dnkmaukltiSicHNkZbBwHAGbKRw= 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 1614183657567636.2010314824519; Wed, 24 Feb 2021 08:20:57 -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-151-icClYHayNXG5hia18ISJag-1; Wed, 24 Feb 2021 11:17:56 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7043150757; Wed, 24 Feb 2021 16:17:48 +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 4AD872BFE2; Wed, 24 Feb 2021 16:17:48 +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 CE6B818077BA; Wed, 24 Feb 2021 16:17: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 11OGHcCI015606 for ; Wed, 24 Feb 2021 11:17:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id EB30B6E505; Wed, 24 Feb 2021 16:17:38 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4403C646DC for ; Wed, 24 Feb 2021 16:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614183654; 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=OX37VHH8nMAXILwQuIv4/9nPzgPOlazKoLXR8RZfMg0=; b=MIrICaUsZUKewj5P2eLp5Rp+WL0B53ltZy/CGGTsOmTFMACjoA6mm4/PQdlkTiSbZJ0Gjc zX+QisO3oGPGca2VFo5Uf/JfbgjNrw0i286d1ZAASDACrKqjz3DXqs1lu6FAE/t/BEWfrC IEOLz1V8z88tW61y+PBINSsTLTqW+D0= X-MC-Unique: icClYHayNXG5hia18ISJag-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/33] virfirewall: Remove OOM checks from virFirewallStartTransaction Date: Wed, 24 Feb 2021 17:16:49 +0100 Message-Id: <97ff114fd37f1244777871cd85debed20e4ab4f6.1614182583.git.pkrempa@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.79 on 10.5.11.11 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" Neither virFirewallGroupNew nor VIR_EXPAND_N can fail. Signed-off-by: Peter Krempa --- src/util/virfirewall.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 95962568f5..66b33d4a91 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -517,18 +517,11 @@ void virFirewallStartTransaction(virFirewallPtr firew= all, VIR_FIREWALL_RETURN_IF_ERROR(firewall); - if (!(group =3D virFirewallGroupNew())) { - firewall->err =3D ENOMEM; - return; - } + group =3D virFirewallGroupNew(); group->actionFlags =3D flags; - if (VIR_EXPAND_N(firewall->groups, - firewall->ngroups, 1) < 0) { - firewall->err =3D ENOMEM; - virFirewallGroupFree(group); - return; - } + ignore_value(VIR_EXPAND_N(firewall->groups, + firewall->ngroups, 1)); firewall->groups[firewall->ngroups - 1] =3D group; firewall->currentGroup =3D firewall->ngroups - 1; } --=20 2.29.2