From: Wang Wensheng Date: Fri, 30 Apr 2021 05:57:58 +0000 (-0700) Subject: mm/sparse: add the missing sparse_buffer_fini() in error branch X-Git-Tag: v4.19.191~132 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c75dd20796f4504eb55e60c4b0d90221cedb8dbe;p=thirdparty%2Fkernel%2Fstable.git mm/sparse: add the missing sparse_buffer_fini() in error branch [ Upstream commit 2284f47fe9fe2ed2ef619e5474e155cfeeebd569 ] 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: 85c77f791390 ("mm/sparse: add new sparse_init_nid() and sparse_init()") Signed-off-by: Wang Wensheng Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- diff --git a/mm/sparse.c b/mm/sparse.c index 3b24ba903d9ee..ed60f0a375fec 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -467,6 +467,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, usemap);