Skip to content

Commit

Permalink
drm/exynos: consider exception case to fb handle creation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Inki Dae committed Feb 21, 2013
1 parent fe9e313 commit b9ede27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/exynos/exynos_drm_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b9ede27

Please sign in to comment.