aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/mm')
-rw-r--r--arch/i386/mm/hugetlbpage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index 57c486f0e896..24c8a536b588 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -46,8 +46,11 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
46 pmd_t *pmd = NULL; 46 pmd_t *pmd = NULL;
47 47
48 pgd = pgd_offset(mm, addr); 48 pgd = pgd_offset(mm, addr);
49 pud = pud_offset(pgd, addr); 49 if (pgd_present(*pgd)) {
50 pmd = pmd_offset(pud, addr); 50 pud = pud_offset(pgd, addr);
51 if (pud_present(*pud))
52 pmd = pmd_offset(pud, addr);
53 }
51 return (pte_t *) pmd; 54 return (pte_t *) pmd;
52} 55}
53 56