fbdev: fix check for fb_mmap's mmio availability
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 24 Apr 2013 05:35:20 +0000 (08:35 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 26 Apr 2013 05:28:56 +0000 (08:28 +0300)
Commit fc9bbca8f650e5f738af8806317c0a041a48ae4a (vm: convert fb_mmap to
vm_iomap_memory() helper) made fbmem.c use vm_iomap_memory, but also
accidentally removed the check for mmio's availability.

Add the check back.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbmem.c

index 86291dc..dcb669e 100644 (file)
@@ -1398,6 +1398,11 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
        len = info->fix.smem_len;
        mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT;
        if (vma->vm_pgoff >= mmio_pgoff) {
+               if (info->var.accel_flags) {
+                       mutex_unlock(&info->mm_lock);
+                       return -EINVAL;
+               }
+
                vma->vm_pgoff -= mmio_pgoff;
                start = info->fix.mmio_start;
                len = info->fix.mmio_len;