summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2013-01-29 08:51:09 (GMT)
committerInki Dae <inki.dae@samsung.com>2013-02-21 06:00:26 (GMT)
commitb9ede277e15916a9ec3c6c1932c390e4768e71a9 (patch)
tree7ffb23a4062b700abd2b03a605ce81540f5226bb /drivers/gpu
parentfe9e3137cffc880b5162f2cc039df48712c496bb (diff)
downloadlinux-fsl-qoriq-b9ede277e15916a9ec3c6c1932c390e4768e71a9.tar.xz
drm/exynos: consider exception case to fb handle creation
GETFB ioctl request creates a new handle to only one gem object so it should check if the given fb has one gem object. 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_fb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 294c051..31d4cb1 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -99,6 +99,10 @@ static int exynos_drm_fb_create_handle(struct drm_framebuffer *fb,
DRM_DEBUG_KMS("%s\n", __FILE__);
+ /* This fb should have only one gem object. */
+ if (WARN_ON(exynos_fb->buf_cnt != 1))
+ return -EINVAL;
+
return drm_gem_handle_create(file_priv,
&exynos_fb->exynos_gem_obj[0]->base, handle);
}