Commit f6ead8de authored by Inki Dae's avatar Inki Dae

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
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment