Skip to content

Commit 172ffeb

Browse files
RichardWeiYangtorvalds
authored andcommitted
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 <richard.weiyang@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent f2f43e5 commit 172ffeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/nobootmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static unsigned long __init __free_memory_core(phys_addr_t start,
118118
unsigned long end_pfn = min_t(unsigned long,
119119
PFN_DOWN(end), max_low_pfn);
120120

121-
if (start_pfn > end_pfn)
121+
if (start_pfn >= end_pfn)
122122
return 0;
123123

124124
__free_pages_memory(start_pfn, end_pfn);

0 commit comments

Comments
 (0)