aboutsummaryrefslogtreecommitdiffstats
path: root/mm/userfaultfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/userfaultfd.c')
-rw-r--r--mm/userfaultfd.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 479e631d43c2..8bcb501bce60 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -128,19 +128,22 @@ out_unlock:
128static pmd_t *mm_alloc_pmd(struct mm_struct *mm, unsigned long address) 128static pmd_t *mm_alloc_pmd(struct mm_struct *mm, unsigned long address)
129{ 129{
130 pgd_t *pgd; 130 pgd_t *pgd;
131 p4d_t *p4d;
131 pud_t *pud; 132 pud_t *pud;
132 pmd_t *pmd = NULL;
133 133
134 pgd = pgd_offset(mm, address); 134 pgd = pgd_offset(mm, address);
135 pud = pud_alloc(mm, pgd, address); 135 p4d = p4d_alloc(mm, pgd, address);
136 if (pud) 136 if (!p4d)
137 /* 137 return NULL;
138 * Note that we didn't run this because the pmd was 138 pud = pud_alloc(mm, p4d, address);
139 * missing, the *pmd may be already established and in 139 if (!pud)
140 * turn it may also be a trans_huge_pmd. 140 return NULL;
141 */ 141 /*
142 pmd = pmd_alloc(mm, pud, address); 142 * Note that we didn't run this because the pmd was
143 return pmd; 143 * missing, the *pmd may be already established and in
144 * turn it may also be a trans_huge_pmd.
145 */
146 return pmd_alloc(mm, pud, address);
144} 147}
145 148
146#ifdef CONFIG_HUGETLB_PAGE 149#ifdef CONFIG_HUGETLB_PAGE