Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2E20A47D931; Sat, 12 Sep 2026 13:08:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789218486; cv=none; b=VuvobPuPAwR3+mM6maATJkuhULK1Ky/VcwC8RiKu1KNlED553U5xkP0m+zloG1wlIT318D3mFgX0xoAY3SAaJv+tU0IBRJr5pp4CDK27/jkLX6Ywkhf9UIxpqPKV0736YuuoEpS44Ba7KKI36eUJAMK7xy4YcoPu/PVzFM4w8xc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789218486; c=relaxed/simple; bh=MZCnD/kex5/T8UFaejra8JJXcQYob+LaLqpbCZ/zwEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MHcsgqqr/SROAxpnepBceYx2dWgmwIU2VhB1M90MkWZ2fE8+Z2uCSf1c60T/QD+DRZAnUVSM4VtPIPKDbqkQQb/SNanrUV8B4M0uUuJ5fc59HgTOiJ4tbQN8WTiiedOq5RQ/jEx4DdpeZJ51v5Ke8wTFbUUnxserWREqroBQhgw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Oj8HWYSD; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Oj8HWYSD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6A2E1F000FF; Sat, 12 Sep 2026 13:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789218483; bh=1i5t7cLwhgJ/LvQJwFcpkv+HHfz6HisfM7B54sBEwuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Oj8HWYSDrSs00TGVslO/aknMyJawiaPz1Vl6dnOMxB2SW8Yz3hno5TfpviGznxf5M v192VHxuW6rmWvVgAe3EoAFbLwe/w8kig9TbhSTEpQejZ04vHJoVN0TDx+Gaju7FR+ qAwu83VesV3djKzKVUr7k7Bf8nIoKo8OK0M6/4j0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zizhi Wo , Damien Le Moal , Bart Van Assche , Nilay Shroff , Jens Axboe , Sasha Levin Subject: [PATCH 6.12 1152/1376] null_blk: free global tag_set on init error path Date: Sat, 12 Sep 2026 08:59:38 +0200 Message-ID: <20260912065633.230618896@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zizhi Wo [ Upstream commit 5a1c5ff3a49ba93a1fd0b70537e7a0164071760d ] If shared_tags is enabled, null_setup_tagset() allocates the global tag_set via null_init_global_tag_set(). If device creation later fails, err_dev destroys the default devices and calls unregister_blkdev(), but never frees the global tag_set. Since module init failed, null_exit() is never invoked, so the global tag_set's tags and maps are permanently leaked. Free the global tag_set in err_dev, matching null_exit() which does if (tag_set.ops) blk_mq_free_tag_set(&tag_set). Fixes: 82f402fefa50 ("null_blk: add support for shared tags") Signed-off-by: Zizhi Wo Reviewed-by: Damien Le Moal Reviewed-by: Bart Van Assche Reviewed-by: Nilay Shroff Link: https://patch.msgid.link/20260725022509.714271-5-wozizhi@huaweicloud.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/null_blk/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 685512ac23958..bde38a4696fef 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -2128,6 +2128,8 @@ static int __init null_init(void) null_destroy_dev(nullb); } unregister_blkdev(null_major, "nullb"); + if (tag_set.ops) + blk_mq_free_tag_set(&tag_set); return ret; } -- 2.53.0