aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index bbab1e37055..48c122d42ed 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -969,7 +969,7 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
969 goto no_page_table; 969 goto no_page_table;
970 970
971 pmd = pmd_offset(pud, address); 971 pmd = pmd_offset(pud, address);
972 if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd))) 972 if (pmd_none(*pmd))
973 goto no_page_table; 973 goto no_page_table;
974 974
975 if (pmd_huge(*pmd)) { 975 if (pmd_huge(*pmd)) {
@@ -978,6 +978,9 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
978 goto out; 978 goto out;
979 } 979 }
980 980
981 if (unlikely(pmd_bad(*pmd)))
982 goto no_page_table;
983
981 ptep = pte_offset_map_lock(mm, pmd, address, &ptl); 984 ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
982 if (!ptep) 985 if (!ptep)
983 goto out; 986 goto out;