From patchwork Wed Oct 11 08:45:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark O'Donovan X-Patchwork-Id: 151213 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp389316vqb; Wed, 11 Oct 2023 01:45:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTR5s9WFz0rkOKFAXGdx/U9YEpZc5gkY2OiYIQ+ZhQcjk3lWDHfigyEUzfNcfwgnAjxZfG X-Received: by 2002:a05:6a00:10c2:b0:68f:c9f6:f366 with SMTP id d2-20020a056a0010c200b0068fc9f6f366mr23282831pfu.0.1697013957543; Wed, 11 Oct 2023 01:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697013957; cv=none; d=google.com; s=arc-20160816; b=OBp8PillIkXqSB0fC4BEEjSamjjvGy/uUsF59upxSZAl+JEnSwVEwizzfpKLFGtxMv HgCyRcdv8Jfo84e3Aq5WJnBt9D4gtkCTNKbfryZ8cejULkkRV4uhZhyRLFXIQUmZUryb um26fOMXucSrsn0jP8mqB8AThyA/UB6a5TfRSyiHL6p6vaEHGsejOw5Ihc4wIhYBTgDd D/jhUqrss9ume2cY+0cA2RWrgHBt9scTUet9M9QTot02PGlzZgElpGmavI1G3R5z9Tbl 0/KR7QGPTdUh649WnZpRyXYLcvYJu1b6vKMCwj4HBJWL2Zk+P3IKLWQ36qUVpJp6fmFE YTYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=x2nUGOzA90IadMHqOcCFazHYvGl83g0lQGxbqBMAidk=; fh=nK/B2gIzvYPsKU0sJgdKEVdz5eoE00hHt727sEimwsQ=; b=ppn/4ojDW6kJTFNNrbuMzrSQ5fvAH37eV8z/2wEMxFrykktphB6t88dXMhMAs8J1PP IZZ7zLH4K4UsyuOJ8oJ8XpQXsaXXVCLSN4vE0/H9O0PX9TTL8DDnns7wgCFviXMfduC8 BFbJOOmTXmcKBC7K7wxE7WziMCY5AGkf6hln+3wYoAFG2jj2aA0S69jFYCupxUplXszN EPN7fFdUNCO294qH3BK0SnDo9wbYHINrEIgBGeCqr5s2ahlllipAVrV0VTBe4pWnUW8L 6w+yFMxixVIim/Sg9GvXE5s4a4j7UqMFA+qDDGm9hK6tZknkrmSi+9Z+uiFj9PgOZkID 7hxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=K4elfQCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id e26-20020a65679a000000b0057cbd803b30si14315339pgr.654.2023.10.11.01.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 01:45:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=K4elfQCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A2D94807F4D6; Wed, 11 Oct 2023 01:45:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230474AbjJKIpn (ORCPT + 19 others); Wed, 11 Oct 2023 04:45:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345681AbjJKIpc (ORCPT ); Wed, 11 Oct 2023 04:45:32 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9AE09C for ; Wed, 11 Oct 2023 01:45:29 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 4D4DD240105 for ; Wed, 11 Oct 2023 10:45:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1697013927; bh=RGojVmI/xMEaWWuoMnRdbYay89Aw9vZzsbfx00TeLGM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=K4elfQCEQPf7k0RYueBGzgvHZaYbvOE0BALBwsudmD8THiXL+irDXXj9xW/OtVQsG mszP5yfpC5FtxOQFFUzg/+2ijV0QqdiaE/3eYSAhSFy45jWWxFkRhi52TMmrCt15D8 eDgPbJp1Art/qzvdj+eWQ1e/eSHC56b+PY9HsCdfpWQsFrgsz673kIqwy+N2l/GSiC gBBK7t1GsG0PPyCywGwM60yDOpDCCGZ189dxA36WkvfBKhX4V5PLfJFEjAtJZtEQpl RytSj4ri6kESkMjypRLUVrx+1nR3Nh8FpC9JX73iQsfNHKc08adeepLlH4yFSRzaFo A0G7e3RqGv7GA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S55v9353sz6tw0; Wed, 11 Oct 2023 10:45:25 +0200 (CEST) From: Mark O'Donovan To: linux-kernel@vger.kernel.org Cc: linux-nvme@lists.infradead.org, sagi@grimberg.me, hch@lst.de, axboe@kernel.dk, kbusch@kernel.org, hare@suse.de, Mark O'Donovan Subject: [PATCH 1/2 RESEND] nvme-auth: unlock mutex in one place only Date: Wed, 11 Oct 2023 08:45:11 +0000 Message-Id: <20231011084512.1835614-1-shiftee@posteo.net> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 01:45:54 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779448107502562363 X-GMAIL-MSGID: 1779448107502562363 Signed-off-by: Mark O'Donovan Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg --- drivers/nvme/host/auth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c index daf5d144a8ea..e1a98647c3a2 100644 --- a/drivers/nvme/host/auth.c +++ b/drivers/nvme/host/auth.c @@ -758,12 +758,11 @@ static void nvme_queue_auth_work(struct work_struct *work) __func__, chap->qid); mutex_lock(&ctrl->dhchap_auth_mutex); ret = nvme_auth_dhchap_setup_host_response(ctrl, chap); + mutex_unlock(&ctrl->dhchap_auth_mutex); if (ret) { - mutex_unlock(&ctrl->dhchap_auth_mutex); chap->error = ret; goto fail2; } - mutex_unlock(&ctrl->dhchap_auth_mutex); /* DH-HMAC-CHAP Step 3: send reply */ dev_dbg(ctrl->device, "%s: qid %d send reply\n",