All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/omap: check plane size
@ 2016-04-26 10:16 Tomi Valkeinen
  2016-04-27 15:30 ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: Tomi Valkeinen @ 2016-04-26 10:16 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen

At the moment we don't check the plane input/output sizes, which can
lead to DSS HW errors when invalid values are given from the userspace.

Add a check so that the sizes are > 0.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 93ee538a99f5..fa9e5086eb65 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -168,6 +168,12 @@ static int omap_plane_atomic_check(struct drm_plane *plane,
 	if (IS_ERR(crtc_state))
 		return PTR_ERR(crtc_state);
 
+	if (state->src_w == 0 || state->src_h == 0)
+		return -EINVAL;
+
+	if (state->crtc_w == 0 || state->crtc_h == 0)
+		return -EINVAL;
+
 	if (state->crtc_x < 0 || state->crtc_y < 0)
 		return -EINVAL;
 
-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-29  7:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26 10:16 [PATCH] drm/omap: check plane size Tomi Valkeinen
2016-04-27 15:30 ` Laurent Pinchart
2016-04-27 17:29   ` Ville Syrjälä
2016-04-27 20:02     ` Laurent Pinchart
2016-04-28 18:30       ` Ville Syrjälä
2016-04-28 21:52         ` Laurent Pinchart
2016-04-29  7:03           ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.