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

Commit f6ead8de authored by Inki Dae's avatar Inki Dae
Browse files

drm/exynos: fixed exynos_drm_gem_map_pages bug.



this patch fixes the problem that the physical memory region to be mapped
to user space could be exceeded. if page fault address was placed at between
buffer start and end then memory region to be mapped would be exceeded.

Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
parent 887ea3db
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -149,21 +149,11 @@ static int exynos_drm_gem_map_pages(struct drm_gem_object *obj,
	unsigned long pfn;

	if (exynos_gem_obj->flags & EXYNOS_BO_NONCONTIG) {
		unsigned long usize = buf->size;

		if (!buf->pages)
			return -EINTR;

		while (usize > 0) {
		pfn = page_to_pfn(buf->pages[page_offset++]);
			vm_insert_mixed(vma, f_vaddr, pfn);
			f_vaddr += PAGE_SIZE;
			usize -= PAGE_SIZE;
		}

		return 0;
	}

	} else
		pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset;

	return vm_insert_mixed(vma, f_vaddr, pfn);