]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - mm/memory_hotplug.c
mm, memory_hotplug: test_pages_in_a_zone do not pass the end of zone
[thirdparty/kernel/stable.git] / mm / memory_hotplug.c
index 5ce0d929ff4821db1c1df259b3b49f147b59b89f..488aa11495d2224f61f6ef9f718db747e41464dd 100644 (file)
@@ -1275,6 +1275,9 @@ int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,
                                i++;
                        if (i == MAX_ORDER_NR_PAGES || pfn + i >= end_pfn)
                                continue;
+                       /* Check if we got outside of the zone */
+                       if (zone && !zone_spans_pfn(zone, pfn + i))
+                               return 0;
                        page = pfn_to_page(pfn + i);
                        if (zone && page_zone(page) != zone)
                                return 0;