Skip to contentSkip to conversation

drm/exynos: consider exception case to fb handle creation

PATCH New Inki Dae 1 participant 1 message Jan 29, 2013

Subsystems (3)
lore
Share & tools
lore

Inki Dae

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/exynos/exynos_drm_fb.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fb.c +4 -0
index 294c051..b751c8a 100644
@@ -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);
 }
Signature · 1 line
1.7.4.1