From nobody Mon Feb 9 19:53:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1639152727; cv=none; d=zohomail.com; s=zohoarc; b=NGWZpvQNELWT8cIlznzSjLldyobk5MnQsd4xitShuJ1EoEJNjZTiVKqpIpuJPfj2GWcFQ3qB9BrYOZAW6zltp4158Wb42BOeRnQFK3NnkbfpHyvH/WtwiiD+/subtgohU3hN8U867zQvty1wxeGYaFKbhOz9I56/q36XLKHUrq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639152727; 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=WrHRUC0IRHsJqeNHiiSHbgWbB4JvMg8SOKoYx2GeJ2Y=; b=LIpWuDVofHWVHvGd89Q+gcJom1J3tAdQwR8/o+6gGuLAoGwxJN2wy3RsHDpMwPv1SyrfYhbgAy6wlFAtwWvK805C1GOA0LydxQM6fur+H6l+l9srVZfF/5njo6URT1WTWy4PhrGB8SFjywFliUZ5FbXPBZmyL8maOjuwoLUwqtk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1639152727049503.51603551126345; Fri, 10 Dec 2021 08:12:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-223-y3cXPyJcNsWTzpkwB4BncQ-1; Fri, 10 Dec 2021 11:12:02 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58C1310151E6; Fri, 10 Dec 2021 16:11:56 +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 2D7E2694DE; Fri, 10 Dec 2021 16:11:56 +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 F15101809C88; Fri, 10 Dec 2021 16:11:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BAG6PVG015254 for ; Fri, 10 Dec 2021 11:06:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 12B6360BF4; Fri, 10 Dec 2021 16:06:25 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8ECC260C04 for ; Fri, 10 Dec 2021 16:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639152726; 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=WrHRUC0IRHsJqeNHiiSHbgWbB4JvMg8SOKoYx2GeJ2Y=; b=Z6VOgikF/IJVNlru8HiubjqD3lAT6IcXCwTlCvPLjmfZz7ce1Y3dLaL5vSO5IzcAkm02TG MQ44BAE2Xd/zEjPSlSGoFeW3qSrfCllRSWOXRSWMiFxYvgQfYEsDhr3SIS8xn8CxsE6W4v FgWLsvGCpVJZpUydUnikapp0P2EoESs= X-MC-Unique: y3cXPyJcNsWTzpkwB4BncQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/8] lxc: remove cleanup from lxcNodeGetSecurityModel Date: Fri, 10 Dec 2021 17:06:16 +0100 Message-Id: <92577aca038a7a17902749b540474d10e995db0e.1639152235.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.13 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) X-ZM-MESSAGEID: 1639152728350100001 Return the values directly. Signed-off-by: J=C3=A1n Tomko --- src/lxc/lxc_driver.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 0d438de4a5..aa4bdd68ac 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1220,32 +1220,26 @@ static int lxcNodeGetSecurityModel(virConnectPtr co= nn, { virLXCDriver *driver =3D conn->privateData; g_autoptr(virCaps) caps =3D NULL; - int ret =3D 0; =20 memset(secmodel, 0, sizeof(*secmodel)); =20 - if (virNodeGetSecurityModelEnsureACL(conn) < 0) { - ret =3D -1; - goto cleanup; - } + if (virNodeGetSecurityModelEnsureACL(conn) < 0) + return -1; =20 - if (!(caps =3D virLXCDriverGetCapabilities(driver, false))) { - ret =3D -1; - goto cleanup; - } + if (!(caps =3D virLXCDriverGetCapabilities(driver, false))) + return -1; =20 /* we treat no driver as success, but simply return no data in *secmod= el */ if (caps->host.nsecModels =3D=3D 0 || caps->host.secModels[0].model =3D=3D NULL) - goto cleanup; + return 0; =20 if (virStrcpy(secmodel->model, caps->host.secModels[0].model, VIR_SECURITY_MODEL_BUFLEN) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("security model string exceeds max %d bytes"), VIR_SECURITY_MODEL_BUFLEN - 1); - ret =3D -1; - goto cleanup; + return -1; } =20 if (virStrcpy(secmodel->doi, caps->host.secModels[0].doi, @@ -1253,12 +1247,10 @@ static int lxcNodeGetSecurityModel(virConnectPtr co= nn, virReportError(VIR_ERR_INTERNAL_ERROR, _("security DOI string exceeds max %d bytes"), VIR_SECURITY_DOI_BUFLEN-1); - ret =3D -1; - goto cleanup; + return -1; } =20 - cleanup: - return ret; + return 0; } =20 =20 --=20 2.31.1