From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24B5B63B8 for ; Mon, 20 Feb 2023 13:54:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E940C433EF; Mon, 20 Feb 2023 13:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676901268; bh=Q4fIJrB9ze0H6fdtNt/wHdDiReKz63ks7CkDFg4tGNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M4j8ZpBxguHky8LEgLnvVXhff2KxYJKZSsvuFXB7aMf/1lTV7yU6N1yEU6vaAlOte yynUU4/GfEmoO7yo0wd4N9BURK7e3nw8ft+qR7N+JWybPczL2Syua01xMtMYfRe6iJ cRbLgvgG1cfdQp+nhY37grwxTIg4oIMAdkj75YV8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Amit Engel , James Smart , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 10/57] nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association Date: Mon, 20 Feb 2023 14:36:18 +0100 Message-Id: <20230220133549.721644720@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230220133549.360169435@linuxfoundation.org> References: <20230220133549.360169435@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Amit Engel [ Upstream commit 0cab4404874f2de52617de8400c844891c6ea1ce ] As part of nvmet_fc_ls_create_association there is a case where nvmet_fc_alloc_target_queue fails right after a new association with an admin queue is created. In this case, no one releases the get taken in nvmet_fc_alloc_target_assoc. This fix is adding the missing put. Signed-off-by: Amit Engel Reviewed-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/target/fc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 640031cbda7cc..46fc44ce86712 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -1675,8 +1675,10 @@ nvmet_fc_ls_create_association(struct nvmet_fc_tgtport *tgtport, else { queue = nvmet_fc_alloc_target_queue(iod->assoc, 0, be16_to_cpu(rqst->assoc_cmd.sqsize)); - if (!queue) + if (!queue) { ret = VERR_QUEUE_ALLOC_FAIL; + nvmet_fc_tgt_a_put(iod->assoc); + } } } -- 2.39.0