Commit 2284f47f authored by Wang Wensheng's avatar Wang Wensheng Committed by Linus Torvalds

mm/sparse: add the missing sparse_buffer_fini() in error branch

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.

Link: https://lkml.kernel.org/r/20210325113155.118574-1-wangwensheng4@huawei.com
Fixes: 85c77f79 ("mm/sparse: add new sparse_init_nid() and sparse_init()")
Signed-off-by: default avatarWang Wensheng <wangwensheng4@huawei.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 943f229e
...@@ -547,6 +547,7 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin, ...@@ -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.", pr_err("%s: node[%d] memory map backing failed. Some memory will not be available.",
__func__, nid); __func__, nid);
pnum_begin = pnum; pnum_begin = pnum;
sparse_buffer_fini();
goto failed; goto failed;
} }
check_usemap_section_nr(nid, usage); check_usemap_section_nr(nid, usage);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment