Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634403 > unrolled thread

[PATCH] mm/nobootmem: return 0 when start_pfn equals end_pfn

Started byWei Yang <richard.weiyang@gmail.com>
First post2017-05-02 15:20 +0200
Last post2017-05-02 15:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm/nobootmem: return 0 when start_pfn equals end_pfn Wei Yang <richard.weiyang@gmail.com> - 2017-05-02 15:20 +0200

#1634403 — [PATCH] mm/nobootmem: return 0 when start_pfn equals end_pfn

FromWei Yang <richard.weiyang@gmail.com>
Date2017-05-02 15:20 +0200
Subject[PATCH] mm/nobootmem: return 0 when start_pfn equals end_pfn
Message-ID<tCFSG-7ab-1@gated-at.bofh.it>
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.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/nobootmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web