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 9D94437BE8C; Mon, 9 Feb 2026 14:47:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648461; cv=none; b=TeOQumfOsK+wWyK3b+JbWVLa+54afsMKgIe0OuLf/s44gUewy0puMTeTJPsWa74UF3iTMUqC/zRLFE+wpnY2+lDkLtcJ04liCK/TjP/4I2hJPrZzJorIY3jrVaJXtY6S9J7lryy8X0UKGMYgf2BaMcAYAjPwhqOUnjP+URtrcS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648461; c=relaxed/simple; bh=ZpxH6I8P6PKxWWxnwOgP+5YdtUroaG702pHdldTUTkg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JWjjRL6SYJmqs47phEZ0tlgv4SA0fekRm6g7tzO8TBnQ+p77NvfvhM/KJ0ynHIbGm9KzP90U/JRRNlpYjHeBijQfD7OiNtgG1H1MPG1w08inKb5jigYyKR3T+X92F7AOIKBDHtKRimsJ5uY7Vcjv1JQlKgX+ZswYa5Gq3DfHVC0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rCl64vbo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rCl64vbo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20D33C19423; Mon, 9 Feb 2026 14:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770648461; bh=ZpxH6I8P6PKxWWxnwOgP+5YdtUroaG702pHdldTUTkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rCl64vbo/KILbp9xVFT8XFqjjsKoJCRVQ7jHNgZrVT20OEUMXiVYlfvoya/Al74do w0JTfP4YlTtV7YsRggp7Db5i4EdmX/eLiL5Biz25Qd4dSoEBL04Fxou+qoAr3Wan8Q xOHqg5X201vwH+qjhJ6CDdiHQH4Qeu3j3CZdhZ3Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yi Zhang , Justin Tee , Chaitanya Kulkarni , Keith Busch , Sasha Levin Subject: [PATCH 6.6 44/86] nvme-fc: release admin tagset if init fails Date: Mon, 9 Feb 2026 15:24:07 +0100 Message-ID: <20260209142306.369524660@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209142304.770150175@linuxfoundation.org> References: <20260209142304.770150175@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chaitanya Kulkarni [ Upstream commit d1877cc7270302081a315a81a0ee8331f19f95c8 ] nvme_fabrics creates an NVMe/FC controller in following path: nvmf_dev_write() -> nvmf_create_ctrl() -> nvme_fc_create_ctrl() -> nvme_fc_init_ctrl() nvme_fc_init_ctrl() allocates the admin blk-mq resources right after nvme_add_ctrl() succeeds. If any of the subsequent steps fail (changing the controller state, scheduling connect work, etc.), we jump to the fail_ctrl path, which tears down the controller references but never frees the admin queue/tag set. The leaked blk-mq allocations match the kmemleak report seen during blktests nvme/fc. Check ctrl->ctrl.admin_tagset in the fail_ctrl path and call nvme_remove_admin_tag_set() when it is set so that all admin queue allocations are reclaimed whenever controller setup aborts. Reported-by: Yi Zhang Reviewed-by: Justin Tee Signed-off-by: Chaitanya Kulkarni Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/host/fc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 4fdb62ae996bf..44de1bcd0c657 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -3550,6 +3550,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, ctrl->ctrl.opts = NULL; + if (ctrl->ctrl.admin_tagset) + nvme_remove_admin_tag_set(&ctrl->ctrl); /* initiate nvme ctrl ref counting teardown */ nvme_uninit_ctrl(&ctrl->ctrl); -- 2.51.0