diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 57053affaad20d053d615b282dcd41fdbf14c742..6f4ce9547658dd7cb1a136304e4f07e9da4280b0 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1073,11 +1073,10 @@ static bool pfn_range_valid_gigantic(struct zone *z, struct page *page; for (i = start_pfn; i < end_pfn; i++) { - if (!pfn_valid(i)) + page = pfn_to_online_page(i); + if (!page) return false; - page = pfn_to_page(i); - if (page_zone(page) != z) return false;