linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Wensheng <wangwensheng4@huawei.com>
To: <akpm@linux-foundation.org>, <osalvador@suse.de>,
	<pasha.tatashin@oracle.com>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Cc: <rui.xiang@huawei.com>
Subject: [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch
Date: Thu, 25 Mar 2021 11:31:55 +0000	[thread overview]
Message-ID: <20210325113155.118574-1-wangwensheng4@huawei.com> (raw)

sparse_buffer_init() and sparse_buffer_fini() should appear in pair, or
a WARN issue would be through the next time sparse_buffer_init() runs.

Add the missing sparse_buffer_fini() in error branch.

Fixes: 85c77f791390 ("mm/sparse: add new sparse_init_nid() and sparse_init()")
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
---
 mm/sparse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/sparse.c b/mm/sparse.c
index 7bd23f9..33406ea 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -547,6 +547,7 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
 			pr_err("%s: node[%d] memory map backing failed. Some memory will not be available.",
 			       __func__, nid);
 			pnum_begin = pnum;
+			sparse_buffer_fini();
 			goto failed;
 		}
 		check_usemap_section_nr(nid, usage);
-- 
2.9.4


             reply	other threads:[~2021-03-25 11:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 11:31 Wang Wensheng [this message]
2021-03-25 12:45 ` [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch David Hildenbrand
2021-03-25 13:21 ` Oscar Salvador
2021-03-26  2:23 Wang Wensheng
2021-03-26  9:11 ` David Hildenbrand

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=20210325113155.118574-1-wangwensheng4@huawei.com \
    --to=wangwensheng4@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=pasha.tatashin@oracle.com \
    --cc=rui.xiang@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;
as well as URLs for NNTP newsgroup(s).