summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-24 08:35:20 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-26 08:28:56 +0300
commit138f296e140f79cb955caba70690076fb14e6f6d (patch)
treeac205dc33305938a0465800336c198ff399a9114
parent04f8afbec37f63fafce16e454a7848426aa36202 (diff)
downloadlinux-3.10-138f296e140f79cb955caba70690076fb14e6f6d.tar.gz
linux-3.10-138f296e140f79cb955caba70690076fb14e6f6d.tar.bz2
linux-3.10-138f296e140f79cb955caba70690076fb14e6f6d.zip
fbdev: fix check for fb_mmap's mmio availability
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>
-rw-r--r--drivers/video/fbmem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 86291dcd964..dcb669eb453 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;