aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 745b3482e6c2..ae259b6e5a21 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1433,12 +1433,11 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
1433 unsigned long address, pte_t *page_table, pmd_t *pmd, 1433 unsigned long address, pte_t *page_table, pmd_t *pmd,
1434 spinlock_t *ptl, pte_t orig_pte) 1434 spinlock_t *ptl, pte_t orig_pte)
1435{ 1435{
1436 struct page *old_page, *src_page, *new_page; 1436 struct page *old_page, *new_page;
1437 pte_t entry; 1437 pte_t entry;
1438 int ret = VM_FAULT_MINOR; 1438 int ret = VM_FAULT_MINOR;
1439 1439
1440 old_page = vm_normal_page(vma, address, orig_pte); 1440 old_page = vm_normal_page(vma, address, orig_pte);
1441 src_page = old_page;
1442 if (!old_page) 1441 if (!old_page)
1443 goto gotten; 1442 goto gotten;
1444 1443
@@ -1466,7 +1465,7 @@ gotten:
1466 1465
1467 if (unlikely(anon_vma_prepare(vma))) 1466 if (unlikely(anon_vma_prepare(vma)))
1468 goto oom; 1467 goto oom;
1469 if (src_page == ZERO_PAGE(address)) { 1468 if (old_page == ZERO_PAGE(address)) {
1470 new_page = alloc_zeroed_user_highpage(vma, address); 1469 new_page = alloc_zeroed_user_highpage(vma, address);
1471 if (!new_page) 1470 if (!new_page)
1472 goto oom; 1471 goto oom;
@@ -1474,7 +1473,7 @@ gotten:
1474 new_page = alloc_page_vma(GFP_HIGHUSER, vma, address); 1473 new_page = alloc_page_vma(GFP_HIGHUSER, vma, address);
1475 if (!new_page) 1474 if (!new_page)
1476 goto oom; 1475 goto oom;
1477 cow_user_page(new_page, src_page, address); 1476 cow_user_page(new_page, old_page, address);
1478 } 1477 }
1479 1478
1480 /* 1479 /*