diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 924553aa8f78..48db3c3d0767 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5449,7 +5449,7 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, likely(pages) ? pages + i : NULL, vmas ? vmas + i : NULL); - if (pages) { + if (pages && pages[i]) { /* * try_grab_compound_head() should always succeed here, * because: a) we hold the ptl lock, and b) we've just