diff options
author | Inki Dae <inki.dae@samsung.com> | 2012-04-23 19:41:14 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2012-04-23 20:31:45 +0900 |
commit | f6ead8dea518d0d02c576432eba4fa145e64b02a (patch) | |
tree | e4e82e1408e4133ef06b40d47d9be9eae4d1d2a3 /drivers/gpu | |
parent | 887ea3db26ec8a43b650ada273e1159492939c10 (diff) | |
download | linux-f6ead8dea518d0d02c576432eba4fa145e64b02a.tar.gz linux-f6ead8dea518d0d02c576432eba4fa145e64b02a.tar.bz2 linux-f6ead8dea518d0d02c576432eba4fa145e64b02a.zip |
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 b1850c30e043..f09d292a2e37 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); } |