Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp956175pxf; Thu, 25 Mar 2021 19:27:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJQQVjyYYDH169GqhsXoyUWzhqXZxMdFkuH1+Dkyb21UA6pjv6Os/7JPjcnEwfJkF2KSzq X-Received: by 2002:a17:906:da0e:: with SMTP id fi14mr13264137ejb.188.1616725674456; Thu, 25 Mar 2021 19:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616725674; cv=none; d=google.com; s=arc-20160816; b=juI4UTbSG+4+CQ6t5kckdilyL2MzrDLqrlGiHlj5kFVpaQ50BHlSSmDyDGtjyDT0tm jdVVpblTxX11sPYEreEUTQEY9X05r8kZZeyUTi9o/viwz8mQwnpUnsFIWs6H96G5utfj 7UzGoP9udMEx8UFrhv1sOGFtD7bTJap67ipZPhwEAqEzv0dpWbi7Xo6Hn6a2ZE2iW0OG fRgihjosru0IZXtK71QDrSX8VnzELnG0QhzZrcBYykBX/YvolBX96tc9qlXdfYv54TNl mfnpIMebhSKENEiED0qpaMT7WXQUzjvrXgoXjdELMKqNLKzz5xRMmLhMOa5VwbeBdux3 DvUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=HX34uK2FyRGyqqecHMrXG0GGOwlEmfvXui8LpL1SoBM=; b=PacRozV4t8oW1YyV3jM2pCSqzt03ObOK2dkv0Wuq7aewDAX3Rr1WGSSp3GiDvDskVQ du0KQiYd7tnCQB5MxjbUkuXvILXc1oiwJ0gWICkwWbvIZjbBKCo5TNA1+7GyktVtaiD3 xSE6ZtMmJ2hOWlcf2+KcOPX6O8FkS9dWRHnMk6whZMmcORqRPxEuevpWf+Hk7e2ZdZdi WRjLj0l5w3CEOkv7WOGYwFv4OnSUi4Ncee9ENHphv7Dx7EOHKZrdplZQ8UtR8i4i0rDe uy4PvqFLVWARf/cEBTNoSuYoNZay9nRxQYfgkw3ZadSLP7CCUvwhrcbWjM3PbSfzjtYf q7Yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si5223469ede.535.2021.03.25.19.27.31; Thu, 25 Mar 2021 19:27:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230509AbhCZC0G (ORCPT + 99 others); Thu, 25 Mar 2021 22:26:06 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:14906 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbhCZCZ7 (ORCPT ); Thu, 25 Mar 2021 22:25:59 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4F65QC2wKpzkg9d; Fri, 26 Mar 2021 10:24:19 +0800 (CST) Received: from huawei.com (10.175.112.208) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Fri, 26 Mar 2021 10:25:50 +0800 From: Wang Wensheng To: , , , , CC: Subject: [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch Date: Fri, 26 Mar 2021 02:23:25 +0000 Message-ID: <20210326022325.3181-1-wangwensheng4@huawei.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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