aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 7d25cc12235f..26f1840879d6 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -163,7 +163,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
163 res.flags = IORESOURCE_MEM; /* we just need system ram */ 163 res.flags = IORESOURCE_MEM; /* we just need system ram */
164 section_end = res.end; 164 section_end = res.end;
165 165
166 while (find_next_system_ram(&res) >= 0) { 166 while ((res.start < res.end) && (find_next_system_ram(&res) >= 0)) {
167 start_pfn = (unsigned long)(res.start >> PAGE_SHIFT); 167 start_pfn = (unsigned long)(res.start >> PAGE_SHIFT);
168 nr_pages = (unsigned long) 168 nr_pages = (unsigned long)
169 ((res.end + 1 - res.start) >> PAGE_SHIFT); 169 ((res.end + 1 - res.start) >> PAGE_SHIFT);