From: Inki Dae Date: Tue, 29 Jan 2013 08:51:09 +0000 (+0900) Subject: drm/exynos: consider exception case to fb handle creation X-Git-Tag: firefly_0821_release~3680^2~1036^2~4^2~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b9ede277e15916a9ec3c6c1932c390e4768e71a9;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Kyungmin Park --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 294c0513f587..31d4cb19736e 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); }