From patchwork Fri Mar 26 02:23:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Wensheng X-Patchwork-Id: 12165613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47062C433E0 for ; Fri, 26 Mar 2021 02:26:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 87B3461A3E for ; Fri, 26 Mar 2021 02:26:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87B3461A3E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D688A6B006E; Thu, 25 Mar 2021 22:26:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3ECA6B0070; Thu, 25 Mar 2021 22:26:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C07666B0071; Thu, 25 Mar 2021 22:26:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id A33B56B006E for ; Thu, 25 Mar 2021 22:26:02 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 685C46C13 for ; Fri, 26 Mar 2021 02:26:02 +0000 (UTC) X-FDA: 77960435364.25.92A5C80 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf16.hostedemail.com (Postfix) with ESMTP id 40FDF80192D5 for ; Fri, 26 Mar 2021 02:26:00 +0000 (UTC) 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 X-Originating-IP: [10.175.112.208] X-CFilter-Loop: Reflected X-Stat-Signature: 16m7qinxi4a16m7a3aiahn9onbmzu4n4 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 40FDF80192D5 Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=szxga06-in.huawei.com; client-ip=45.249.212.32 X-HE-DKIM-Result: none/none X-HE-Tag: 1616725560-587434 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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);