From: "Huang, Ying" <ying.huang@intel.com>
To: Tong Tiangen <tongtiangen@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>,
<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<wangkefeng.wang@huawei.com>, Guohanjun <guohanjun@huawei.com>
Subject: Re: [PATCH -next] memory tier: release the new_memtier in find_create_memory_tier()
Date: Mon, 30 Jan 2023 16:17:55 +0800 [thread overview]
Message-ID: <87edrctozw.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <20230129040651.1329208-1-tongtiangen@huawei.com> (Tong Tiangen's message of "Sun, 29 Jan 2023 04:06:51 +0000")
Tong Tiangen <tongtiangen@huawei.com> writes:
> 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.
>
> Fixes: 9832fb87834e ("mm/demotion: expose memory tier details via sysfs")
> Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
> ---
> mm/memory-tiers.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
> index c734658c6242..e593e56e530b 100644
> --- a/mm/memory-tiers.c
> +++ b/mm/memory-tiers.c
> @@ -211,8 +211,8 @@ static struct memory_tier *find_create_memory_tier(struct memory_dev_type *memty
>
> 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;
Good catch! Thanks!
I think that this should be in stable since v6.1.
Best Regards,
Huang, Ying
prev parent reply other threads:[~2023-01-30 8:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 4:06 Tong Tiangen
2023-01-30 8:17 ` Huang, Ying [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87edrctozw.fsf@yhuang6-desk2.ccr.corp.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=guohanjun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tongtiangen@huawei.com \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox