aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 6359a4f80c4a..fc38d4ed9ad9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2653,7 +2653,8 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
2653 goto oom_free_page; 2653 goto oom_free_page;
2654 2654
2655 entry = mk_pte(page, vma->vm_page_prot); 2655 entry = mk_pte(page, vma->vm_page_prot);
2656 entry = maybe_mkwrite(pte_mkdirty(entry), vma); 2656 if (vma->vm_flags & VM_WRITE)
2657 entry = pte_mkwrite(pte_mkdirty(entry));
2657 2658
2658 page_table = pte_offset_map_lock(mm, pmd, address, &ptl); 2659 page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
2659 if (!pte_none(*page_table)) 2660 if (!pte_none(*page_table))