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 164951c47305..cef95c8c77fa 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1575,11 +1575,10 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
1575 * behaviour that some programs depend on. We mark the "original" 1575 * behaviour that some programs depend on. We mark the "original"
1576 * un-COW'ed pages by matching them up with "vma->vm_pgoff". 1576 * un-COW'ed pages by matching them up with "vma->vm_pgoff".
1577 */ 1577 */
1578 if (is_cow_mapping(vma->vm_flags)) { 1578 if (addr == vma->vm_start && end == vma->vm_end)
1579 if (addr != vma->vm_start || end != vma->vm_end)
1580 return -EINVAL;
1581 vma->vm_pgoff = pfn; 1579 vma->vm_pgoff = pfn;
1582 } 1580 else if (is_cow_mapping(vma->vm_flags))
1581 return -EINVAL;
1583 1582
1584 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; 1583 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
1585 1584