diff options
Diffstat (limited to 'mm/mremap.c')
-rw-r--r-- | mm/mremap.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/mm/mremap.c b/mm/mremap.c index ccf456477020..616facc3d28a 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -51,7 +51,6 @@ static pmd_t *alloc_new_pmd(struct mm_struct *mm, unsigned long addr) | |||
51 | pgd_t *pgd; | 51 | pgd_t *pgd; |
52 | pud_t *pud; | 52 | pud_t *pud; |
53 | pmd_t *pmd = NULL; | 53 | pmd_t *pmd = NULL; |
54 | pte_t *pte; | ||
55 | 54 | ||
56 | /* | 55 | /* |
57 | * We do need page_table_lock: because allocators expect that. | 56 | * We do need page_table_lock: because allocators expect that. |
@@ -66,12 +65,8 @@ static pmd_t *alloc_new_pmd(struct mm_struct *mm, unsigned long addr) | |||
66 | if (!pmd) | 65 | if (!pmd) |
67 | goto out; | 66 | goto out; |
68 | 67 | ||
69 | pte = pte_alloc_map(mm, pmd, addr); | 68 | if (!pmd_present(*pmd) && __pte_alloc(mm, pmd, addr)) |
70 | if (!pte) { | ||
71 | pmd = NULL; | 69 | pmd = NULL; |
72 | goto out; | ||
73 | } | ||
74 | pte_unmap(pte); | ||
75 | out: | 70 | out: |
76 | spin_unlock(&mm->page_table_lock); | 71 | spin_unlock(&mm->page_table_lock); |
77 | return pmd; | 72 | return pmd; |