This is a note to let you know that I've just added the patch titled memory tier: release the new_memtier in find_create_memory_tier() to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: memory-tier-release-the-new_memtier-in-find_create_memory_tier.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 93419139fa14124c1c507d804f2b28866ebee28d Mon Sep 17 00:00:00 2001 From: Tong Tiangen <tongtiangen@xxxxxxxxxx> Date: Sun, 29 Jan 2023 04:06:51 +0000 Subject: memory tier: release the new_memtier in find_create_memory_tier() From: Tong Tiangen <tongtiangen@xxxxxxxxxx> commit 93419139fa14124c1c507d804f2b28866ebee28d upstream. In find_create_memory_tier(), if failed to register device, then we should release new_memtier from the tier list and put device instead of memtier. Link: https://lkml.kernel.org/r/20230129040651.1329208-1-tongtiangen@xxxxxxxxxx Fixes: 9832fb87834e ("mm/demotion: expose memory tier details via sysfs") Signed-off-by: Tong Tiangen <tongtiangen@xxxxxxxxxx> Cc: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx> Cc: Hanjun Guo <guohanjun@xxxxxxxxxx> Cc: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Cc: Guohanjun <guohanjun@xxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- mm/memory-tiers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -211,8 +211,8 @@ static struct memory_tier *find_create_m ret = device_register(&new_memtier->dev); if (ret) { - list_del(&memtier->list); - put_device(&memtier->dev); + list_del(&new_memtier->list); + put_device(&new_memtier->dev); return ERR_PTR(ret); } memtier = new_memtier; Patches currently in stable-queue which might be from tongtiangen@xxxxxxxxxx are queue-6.2/memory-tier-release-the-new_memtier-in-find_create_memory_tier.patch