aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index f5d6799b8a74..2f855babfd06 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -364,9 +364,10 @@ vma_address(struct page *page, struct vm_area_struct *vma)
364 */ 364 */
365unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) 365unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma)
366{ 366{
367 if (PageAnon(page)) 367 if (PageAnon(page)) {
368 ; 368 if (vma->anon_vma->root != page_anon_vma(page)->root)
369 else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { 369 return -EFAULT;
370 } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {
370 if (!vma->vm_file || 371 if (!vma->vm_file ||
371 vma->vm_file->f_mapping != page->mapping) 372 vma->vm_file->f_mapping != page->mapping)
372 return -EFAULT; 373 return -EFAULT;