From 433dc3f7d3ee7b7e3da241f04e43b78255756242 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 24 Apr 2013 08:35:20 +0300 Subject: [PATCH] fbdev: fix check for fb_mmap's mmio availability Commit ef62c554ee9b46a1913836f72015de1e036f026d (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 --- drivers/video/fbmem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 86291dcd964a9..dcb669eb45329 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -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; -- 2.39.5