From: David Hildenbrand <david@redhat.com>
To: Yang Yingliang <yangyingliang@huawei.com>, linux-mm@kvack.org
Cc: osalvador@suse.de, akpm@linux-foundation.org, mhocko@suse.com,
aneesh.kumar@linux.ibm.com
Subject: Re: [PATCH -next] mm/memory_hotplug: fix error return code in add_memory_resource()
Date: Wed, 9 Aug 2023 10:39:01 +0200 [thread overview]
Message-ID: <8d99a10b-6579-cdcf-3b82-4859a3a35005@redhat.com> (raw)
In-Reply-To: <20230809081552.1351184-1-yangyingliang@huawei.com>
On 09.08.23 10:15, Yang Yingliang wrote:
> Set error return code to -ENOMEM, when kmalloc() fails.
>
> Fixes: ad3232df3e41 ("mm/memory_hotplug: embed vmem_altmap details in memory block")
Commit id is not stable yet.
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> mm/memory_hotplug.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index f8d3e7427e32..1b03f4ec6fd2 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1440,8 +1440,10 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags)
> if (mhp_supports_memmap_on_memory(size)) {
> mhp_altmap.free = memory_block_memmap_on_memory_pages();
> params.altmap = kmalloc(sizeof(struct vmem_altmap), GFP_KERNEL);
> - if (!params.altmap)
> + if (!params.altmap) {
> + ret = -ENOMEM;
> goto error;
> + }
LGTM, should be squashed into the original commit.
Thanks!
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2023-08-09 8:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 8:15 Yang Yingliang
2023-08-09 8:39 ` David Hildenbrand [this message]
2023-08-09 9:19 ` Aneesh Kumar K.V
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=8d99a10b-6579-cdcf-3b82-4859a3a35005@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=yangyingliang@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