diff options
author | Inki Dae <inki.dae@samsung.com> | 2012-04-23 10:41:14 (GMT) |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2012-04-23 11:31:45 (GMT) |
commit | f6ead8dea518d0d02c576432eba4fa145e64b02a (patch) | |
tree | e4e82e1408e4133ef06b40d47d9be9eae4d1d2a3 /drivers/gpu | |
parent | 887ea3db26ec8a43b650ada273e1159492939c10 (diff) | |
download | linux-f6ead8dea518d0d02c576432eba4fa145e64b02a.tar.xz |
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: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index b1850c3..f09d292 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -149,22 +149,12 @@ 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; - } - - pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset; + pfn = page_to_pfn(buf->pages[page_offset++]); + } else + pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset; return vm_insert_mixed(vma, f_vaddr, pfn); } |