do allow reading from read only mappings...
authorMichel Daenzer <michel@daenzer.net>
Sat, 17 May 2003 00:37:34 +0000 (00:37 +0000)
committerMichel Daenzer <michel@daenzer.net>
Sat, 17 May 2003 00:37:34 +0000 (00:37 +0000)
linux-core/drm_vm.c
linux/drm_vm.h

index 59b19da..f9c1e35 100644 (file)
@@ -416,7 +416,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
        if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
 
        if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
        if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
 
        if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
-               vma->vm_flags &= VM_MAYWRITE;
+               vma->vm_flags &= (VM_READ | VM_MAYREAD);
 #if defined(__i386__) || defined(__x86_64__)
                pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
 #else
 #if defined(__i386__) || defined(__x86_64__)
                pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
 #else
index 59b19da..f9c1e35 100644 (file)
@@ -416,7 +416,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
        if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
 
        if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
        if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
 
        if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
-               vma->vm_flags &= VM_MAYWRITE;
+               vma->vm_flags &= (VM_READ | VM_MAYREAD);
 #if defined(__i386__) || defined(__x86_64__)
                pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
 #else
 #if defined(__i386__) || defined(__x86_64__)
                pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
 #else