From patchwork Tue Jul 9 18:55:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 168767 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8917369ilk; Tue, 9 Jul 2019 11:56:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQ0csTZV1hEuDV/FEwzSZP8TqXbd6kTWUdrso4E9hLMiHeifkqZp2GpB9MsSkRNbUdTura X-Received: by 2002:a17:902:e287:: with SMTP id cf7mr33529656plb.32.1562698569248; Tue, 09 Jul 2019 11:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562698569; cv=none; d=google.com; s=arc-20160816; b=Fkl9tf7qrlrdtmZGz7qlNDT1M25s97HGKV6J0IPqI0WXCIy6oYHVfuZZBTyLV9x2Jf xYDHw/xXtmEx3aHXX4OdzH+wL8uzpef0cq+LsUe1MNz66R9EYSYSuhTLhCpDhuyU+X6H DGVGJpY3WLMpHjE/SisiEJEl3FTCxVFs1lk3L/NRWFINLlOq+nnn7xIMESTnzX5k/gkv DnFYelV5Dab9J9DNA3WL9Gvmnsb5VwAteRCopWL9/R38nbwbMKT0zC2ON+QBnfO+o941 bsdtpdm83gHE866wfNraVIEjN4vfSirW9ZpFuwepfNakArDjMWsQmCe1h03OmjE9XOfD GBxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5xqV2Lb5KecX8IhtaHyJbfxJMgfFlWDd0B4Flce/i8Q=; b=SINbozx+ZBFjHUk5lXQXFHmVKu2BZCZrBslQF4Pl/ZxqD8sdZB/b+TT1EnFwRbrmPe 0UIfFhoblB7UING1dZ45rIbc1bUXn66EHjgCEwchrikRbflgpwl2QCRFPgJj0SdktKJl lBtdfxjSWxjPcFL98H3kF5fYxnz/aVNE+vUDasLGeP53KLOBBGy8+RmSa21dSrMFQ8Yr 4fbioJXjVEG1b43r9Z4tu25GHhZ3T2yp0RfQ6WgM0nPxPtrBL47tmVw6hTP2YVYxLbF+ nVGz+Fd5uTgCO6FGYhyf4uhXKdX4Uh00nY5Ivett2y/rzCsQwChj/YDVUcnPM+zEcfUU AzTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si21470536plo.384.2019.07.09.11.56.08; Tue, 09 Jul 2019 11:56:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729444AbfGIS4H (ORCPT + 30 others); Tue, 9 Jul 2019 14:56:07 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:50211 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbfGIS4H (ORCPT ); Tue, 9 Jul 2019 14:56:07 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MV6Bs-1ht4UM2gFi-00SAJu; Tue, 09 Jul 2019 20:55:32 +0200 From: Arnd Bergmann To: Andrew Morton Cc: Lecopzer Chen , Mark-PK Tsai , Arnd Bergmann , Oscar Salvador , Michal Hocko , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/sparse.c: mark sparse_buffer_free as __meminit Date: Tue, 9 Jul 2019 20:55:07 +0200 Message-Id: <20190709185528.3251709-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:dVuJ+e4kut2pBGD0f44Tc4g9wI+Sx6SMYC65vDceSfeBL8Yrh+N QNGHbxDD8YGcxeGUylFBPh2+1bqSGZD7fY2xzD4DuBrL6v+lkqQlguvHdgwjCswrVGx0YTH Ei8xRNQutUg89MivWr34gzxK4A0qtbmc/bwPqX+Ro6d0AKd1DALUkvtQnCKRHpDo8N4C/cH PXTpKClIVFlzJz6klNUKQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:m6/WP9gsIM8=://qaXXPJjdjdLwFXs/UQEw +imM3iOlc931kOkt2KJoAkJMtnNtcB+ECAqcccp5LqSZ3ZDoYw7uVgg/aT3s3kBDKyU4CZ91+ 2Vv8UpHhZZoJXqrINVUJ8Du1cwhPcS4ZsnJ21M5qOYaKY1jkttUcJCkKERpJq1IpUCifqgOze mKvXl0BLByMoOsx0q3wapfs4860AqLAaqyz48b9NGKVcne1njGvfLfitEQC5RzGOLwJG9Xe1Z F6/zmu4tTBuXiw90z5Ux0bs1+KAkSfgqXDaupSq7BAbQnLVdlXaHNkL9VK/eb4B2ezZ/34NeV MiiefBC8t4cjbufi6ryt5N3y2yroSgI2eWwz2FcrpGYb4lsJd5WYCo6AbNqdXnPC+OVUyB6Wc MLYwE0vTk91UACyfh2+tle7bfjU3ClroCy9kGhBi+mjWKm1jc58gmuMlR+Jaqwu8TewKdLmQv XNl8NaGgSEcGsFWzlV8BcB7MIn7u/tIs0jQ8nDWHyxygclcwEk/Yd4D6V692Om8veoGdlx1gu TzYzg9SKzJhRwiPUDRI3k+WyNZWezRG/2qvOpIMDFTUQRLD0ffbTGoTCsNpFnOgp6wVdO5/EA lZrmXTsVfpFEaMWIvX8u+xilTzIr8Lr9SdU273CuvBlAMW1Rz5tIwmVLSdqw+JaR3QdVcXSIq LBIa5aiZKVRYszZlP3mu3UyXhpUxO3LxicJ+8O6JszIV2dLW1Guy37mq6jWmxne7b4rfIoisw 2m3oWKIhTpFb0cn56zAlG3ImsCaDSmHu1cS8Dg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Calling an __init function from a __meminit function is not allowed: WARNING: vmlinux.o(.meminit.text+0x30ff): Section mismatch in reference from the function sparse_buffer_alloc() to the function .init.text:sparse_buffer_free() The function __meminit sparse_buffer_alloc() references a function __init sparse_buffer_free(). If sparse_buffer_free is only used by sparse_buffer_alloc then annotate sparse_buffer_free with a matching annotation. Downgrade the annotation to __meminit for both, as they may be used in the hotplug case. Fixes: mmotm ("mm/sparse.c: fix memory leak of sparsemap_buf in aliged memory") Signed-off-by: Arnd Bergmann --- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 diff --git a/mm/sparse.c b/mm/sparse.c index 3267c4001c6d..4801d45bd66e 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -470,7 +470,7 @@ struct page __init *__populate_section_memmap(unsigned long pfn, static void *sparsemap_buf __meminitdata; static void *sparsemap_buf_end __meminitdata; -static inline void __init sparse_buffer_free(unsigned long size) +static inline void __meminit sparse_buffer_free(unsigned long size) { WARN_ON(!sparsemap_buf || size == 0); memblock_free_early(__pa(sparsemap_buf), size);