提交 f6ead8de 编写于 作者: I 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: NInki Dae <inki.dae@samsung.com>
Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
上级 887ea3db
...@@ -149,22 +149,12 @@ static int exynos_drm_gem_map_pages(struct drm_gem_object *obj, ...@@ -149,22 +149,12 @@ static int exynos_drm_gem_map_pages(struct drm_gem_object *obj,
unsigned long pfn; unsigned long pfn;
if (exynos_gem_obj->flags & EXYNOS_BO_NONCONTIG) { if (exynos_gem_obj->flags & EXYNOS_BO_NONCONTIG) {
unsigned long usize = buf->size;
if (!buf->pages) if (!buf->pages)
return -EINTR; return -EINTR;
while (usize > 0) { pfn = page_to_pfn(buf->pages[page_offset++]);
pfn = page_to_pfn(buf->pages[page_offset++]); } else
vm_insert_mixed(vma, f_vaddr, pfn); pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset;
f_vaddr += PAGE_SIZE;
usize -= PAGE_SIZE;
}
return 0;
}
pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset;
return vm_insert_mixed(vma, f_vaddr, pfn); return vm_insert_mixed(vma, f_vaddr, pfn);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册