Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 138f296e authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

fbdev: fix check for fb_mmap's mmio availability



Commit fc9bbca8 (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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 04f8afbe
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -1398,6 +1398,11 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
	len = info->fix.smem_len;
	len = info->fix.smem_len;
	mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT;
	mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT;
	if (vma->vm_pgoff >= mmio_pgoff) {
	if (vma->vm_pgoff >= mmio_pgoff) {
		if (info->var.accel_flags) {
			mutex_unlock(&info->mm_lock);
			return -EINVAL;
		}

		vma->vm_pgoff -= mmio_pgoff;
		vma->vm_pgoff -= mmio_pgoff;
		start = info->fix.mmio_start;
		start = info->fix.mmio_start;
		len = info->fix.mmio_len;
		len = info->fix.mmio_len;