aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mremap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mremap.c')
-rw-r--r--mm/mremap.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mm/mremap.c b/mm/mremap.c
index 8233b0105c82..cd8a1b199ef9 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -32,6 +32,7 @@
32static pmd_t *get_old_pmd(struct mm_struct *mm, unsigned long addr) 32static pmd_t *get_old_pmd(struct mm_struct *mm, unsigned long addr)
33{ 33{
34 pgd_t *pgd; 34 pgd_t *pgd;
35 p4d_t *p4d;
35 pud_t *pud; 36 pud_t *pud;
36 pmd_t *pmd; 37 pmd_t *pmd;
37 38
@@ -39,7 +40,11 @@ static pmd_t *get_old_pmd(struct mm_struct *mm, unsigned long addr)
39 if (pgd_none_or_clear_bad(pgd)) 40 if (pgd_none_or_clear_bad(pgd))
40 return NULL; 41 return NULL;
41 42
42 pud = pud_offset(pgd, addr); 43 p4d = p4d_offset(pgd, addr);
44 if (p4d_none_or_clear_bad(p4d))
45 return NULL;
46
47 pud = pud_offset(p4d, addr);
43 if (pud_none_or_clear_bad(pud)) 48 if (pud_none_or_clear_bad(pud))
44 return NULL; 49 return NULL;
45 50
@@ -54,11 +59,15 @@ static pmd_t *alloc_new_pmd(struct mm_struct *mm, struct vm_area_struct *vma,
54 unsigned long addr) 59 unsigned long addr)
55{ 60{
56 pgd_t *pgd; 61 pgd_t *pgd;
62 p4d_t *p4d;
57 pud_t *pud; 63 pud_t *pud;
58 pmd_t *pmd; 64 pmd_t *pmd;
59 65
60 pgd = pgd_offset(mm, addr); 66 pgd = pgd_offset(mm, addr);
61 pud = pud_alloc(mm, pgd, addr); 67 p4d = p4d_alloc(mm, pgd, addr);
68 if (!p4d)
69 return NULL;
70 pud = pud_alloc(mm, p4d, addr);
62 if (!pud) 71 if (!pud)
63 return NULL; 72 return NULL;
64 73