From nobody Tue Apr 28 17:04:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE3A5C433FE for ; Tue, 31 May 2022 12:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344242AbiEaM0i (ORCPT ); Tue, 31 May 2022 08:26:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232586AbiEaM0f (ORCPT ); Tue, 31 May 2022 08:26:35 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1543165406 for ; Tue, 31 May 2022 05:26:35 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LCBMz0BLCzDqWB; Tue, 31 May 2022 20:26:23 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 31 May 2022 20:26:32 +0800 From: Miaohe Lin To: CC: , , , , , Subject: [PATCH] mm/memremap: fix missing call to untrack_pfn() in pagemap_range() Date: Tue, 31 May 2022 20:26:43 +0800 Message-ID: <20220531122643.25249-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We forget to call untrack_pfn() to pair with track_pfn_remap() when range is not allowed to hotplug. Fix it by jump err_kasan. Fixes: bca3feaa0764 ("mm/memory_hotplug: prevalidate the address range bein= g added with platform") Signed-off-by: Miaohe Lin Acked-by: Muchun Song Reviewed-by: David Hildenbrand --- mm/memremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memremap.c b/mm/memremap.c index 2b92e97cb25b..b870a659eee6 100644 --- a/mm/memremap.c +++ b/mm/memremap.c @@ -214,7 +214,7 @@ static int pagemap_range(struct dev_pagemap *pgmap, str= uct mhp_params *params, =20 if (!mhp_range_allowed(range->start, range_len(range), !is_private)) { error =3D -EINVAL; - goto err_pfn_remap; + goto err_kasan; } =20 mem_hotplug_begin(); --=20 2.23.0