From: Miaohe Lin Date: Tue, 31 May 2022 12:26:43 +0000 (+0800) Subject: mm/memremap: fix missing call to untrack_pfn() in pagemap_range() X-Git-Tag: v6.1-rc5~1117^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a04e1928e2ead144dc2f369768bc0a0f3110af89;p=platform%2Fkernel%2Flinux-starfive.git mm/memremap: fix missing call to untrack_pfn() in pagemap_range() 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. Link: https://lkml.kernel.org/r/20220531122643.25249-1-linmiaohe@huawei.com Fixes: bca3feaa0764 ("mm/memory_hotplug: prevalidate the address range being added with platform") Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Acked-by: Muchun Song Cc: Anshuman Khandual Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton --- diff --git a/mm/memremap.c b/mm/memremap.c index 2b92e97..b870a65 100644 --- a/mm/memremap.c +++ b/mm/memremap.c @@ -214,7 +214,7 @@ static int pagemap_range(struct dev_pagemap *pgmap, struct mhp_params *params, if (!mhp_range_allowed(range->start, range_len(range), !is_private)) { error = -EINVAL; - goto err_pfn_remap; + goto err_kasan; } mem_hotplug_begin();