From: Wei Yang Date: Thu, 6 Jul 2017 22:36:53 +0000 (-0700) Subject: mm/nobootmem.c: return 0 when start_pfn equals end_pfn X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=172ffeb9b9c284c6676ce03721cccf9b4ec6680b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mm/nobootmem.c: return 0 when start_pfn equals end_pfn When start_pfn equals end_pfn, __free_pages_memory() has no effect and __free_memory_core() will finally return (end_pfn - start_pfn) = 0. This patch returns 0 directly when start_pfn equals end_pfn. Link: http://lkml.kernel.org/r/20170502131115.6650-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/nobootmem.c b/mm/nobootmem.c index 487dad610731..36454d0f96ee 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -118,7 +118,7 @@ static unsigned long __init __free_memory_core(phys_addr_t start, unsigned long end_pfn = min_t(unsigned long, PFN_DOWN(end), max_low_pfn); - if (start_pfn > end_pfn) + if (start_pfn >= end_pfn) return 0; __free_pages_memory(start_pfn, end_pfn);