Skip to contentSkip to conversation

mm/nobootmem: return 0 when start_pfn equals end_pfn

PATCH Applied Wei Yang 1 participant 1 message May 2, 2017 Memory management

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 mm/nobootmem: return 0 when start_pfn equals end_pfn

When start_pfn equals end_pfn, __free_pages_memory() takes 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.

---
 mm/nobootmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/nobootmem.c +1 -1
index 487dad610731..36454d0f96ee 100644
@@ -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);
Signature · 7 lines
2.11.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>