From nobody Mon Feb 9 16:21:13 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=1612284992; cv=none; d=zohomail.com; s=zohoarc; b=fJj2fQsJMBRIldtPtTRk8HbLrTmsYXJjD6KTaGobdedkN6gFTpYNhbFhkOwQJ/l02Ax+3DGlMMyO6F6fswwteQQ5hLXYOrdJ7R7F0cTF7ORY52RE9YHCGTyvvorpSOXzO36aZshJJt+yXRtukrN1YpuZN6xLiuiMdViBkYfPpjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612284992; 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=1oaNLbsmnmgEDaOsBOjwNEAy3Aq3N9aZYkWUK583H68=; b=bxBMCqNNqU7dRoHr6w1RNeVfTOvlVVNhjGXA+nn93pGytsp1bYx0xirnXOuvEiKEPVXpPaRn9szVmb6VY9skazUfJNhVpA7t+oLnZwNFUS115bS/tFTW3e53kdO3n/TzbqWQKGYBOJr+nz4qXJ/9fVb0l9EwlA9mRkBDWiYtFl8= 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 1612284992890746.9386258386131; Tue, 2 Feb 2021 08:56:32 -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-491-axN_jVX9Os25fnEyeZv6hA-1; Tue, 02 Feb 2021 11:56:28 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 502828710F6; Tue, 2 Feb 2021 16:56:22 +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 220E654564; Tue, 2 Feb 2021 16:56:22 +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 DDFDE5003E; Tue, 2 Feb 2021 16:56:21 +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 112GuKIM014897 for ; Tue, 2 Feb 2021 11:56:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 03F716E510; Tue, 2 Feb 2021 16:56:20 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B9DC60862 for ; Tue, 2 Feb 2021 16:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612284991; 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=1oaNLbsmnmgEDaOsBOjwNEAy3Aq3N9aZYkWUK583H68=; b=KL1P/6dQYRxxw6lEjIkGO82JW+EjqQrcDl5ccwtSLIm8Sr6zzuuTXzd1r0FA+81x3Zfn9i gudrQcEdMy7MJ11vixHLhBjW49uTAb1BMY8dndml9SMyMQy//b3EsQJI1ulJVVyByhOhL6 U2/5eeOLLmK7TdgqtO+FFMlbfALFcz4= X-MC-Unique: axN_jVX9Os25fnEyeZv6hA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 05/27] virNetLibsshSessionAuthAddPrivKeyAuth: Don't unlock unlocked 'sess' on error Date: Tue, 2 Feb 2021 17:55:42 +0100 Message-Id: <81a0c902a458c03296c9c9005a2171050b874b66.1612284661.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.15 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" The check whether @keyfile is non-NULL is before locking @sess, but uses the 'error' label which unlocks '@sess'. While touching the error path, update the error message to be on one line. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/rpc/virnetlibsshsession.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 959a16a6a9..ed697c7ce4 100644 --- a/src/rpc/virnetlibsshsession.c +++ b/src/rpc/virnetlibsshsession.c @@ -1020,10 +1020,8 @@ virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSe= ssionPtr sess, if (!keyfile) { virReportError(VIR_ERR_LIBSSH, "%s", - _("Key file path must be provided " - "for private key authentication")); - ret =3D -1; - goto error; + _("Key file path must be provided for private key a= uthentication")); + return -1; } virObjectLock(sess); --=20 2.29.2