diff options
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_file_ops.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index 0b6e7679eefd..e999a46bef9b 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c | |||
@@ -992,15 +992,10 @@ static int mmap_piobufs(struct vm_area_struct *vma, | |||
992 | pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED; | 992 | pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED; |
993 | #endif | 993 | #endif |
994 | 994 | ||
995 | if (vma->vm_flags & VM_READ) { | 995 | /* |
996 | dev_info(&dd->pcidev->dev, | 996 | * don't allow them to later change to readable with mprotect (for when |
997 | "Can't map piobufs as readable (flags=%lx)\n", | 997 | * not initially mapped readable, as is normally the case) |
998 | vma->vm_flags); | 998 | */ |
999 | ret = -EPERM; | ||
1000 | goto bail; | ||
1001 | } | ||
1002 | |||
1003 | /* don't allow them to later change to readable with mprotect */ | ||
1004 | vma->vm_flags &= ~VM_MAYREAD; | 999 | vma->vm_flags &= ~VM_MAYREAD; |
1005 | vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; | 1000 | vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; |
1006 | 1001 | ||