vm audit: add VM_DONTEXPAND to mmap for drivers that need it
[sfrench/cifs-2.6.git] / drivers / char / drm / drm_vm.c
index e8d50af58201825effe532d775362187a90b46fc..ef5e6b130c4845aa8b3ad68b36538b34d90e6311 100644 (file)
@@ -506,6 +506,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
        vma->vm_ops = &drm_vm_dma_ops;
 
        vma->vm_flags |= VM_RESERVED;   /* Don't swap */
+       vma->vm_flags |= VM_DONTEXPAND;
 
        vma->vm_file = filp;    /* Needed for drm_vm_open() */
        drm_vm_open_locked(vma);
@@ -655,6 +656,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
                return -EINVAL; /* This should never happen. */
        }
        vma->vm_flags |= VM_RESERVED;   /* Don't swap */
+       vma->vm_flags |= VM_DONTEXPAND;
 
        vma->vm_file = filp;    /* Needed for drm_vm_open() */
        drm_vm_open_locked(vma);