dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: dri-devel@lists.freedesktop.org
Cc: tomi.valkeinen@ti.com, Jyri Sarha <jsarha@ti.com>,
	laurent.pinchart@ideasonboard.com
Subject: [PATCH RFC] drm: Fix property handling for mode object without object type
Date: Thu, 1 Sep 2016 16:39:22 +0300	[thread overview]
Message-ID: <1472737162-3507-1-git-send-email-jsarha@ti.com> (raw)

Fix property handling for mode object without mode object type.
drm_property_change_valid_get() crashes if atomic ioctl for mode
object does not specify the mode object type. This patch makes
drm_property_change_valid_get() to tolerate such requests.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---

This used to work in v4.8, but I have no idea if this is a right fix
or should we just gracefully reject ioctls to mode object properties
without mode object type. In such a case we need to fix our test tool [1].

[1] https://github.com/tomba/kmsxx

 drivers/gpu/drm/drm_property.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
index 4139afb..67261a2 100644
--- a/drivers/gpu/drm/drm_property.c
+++ b/drivers/gpu/drm/drm_property.c
@@ -877,7 +877,9 @@ bool drm_property_change_valid_get(struct drm_property *property,
 			return true;
 
 		*ref = __drm_mode_object_find(property->dev, value,
-					      property->values[0]);
+					      property->num_values ?
+					      property->values[0] :
+					      DRM_MODE_OBJECT_ANY);
 		return *ref != NULL;
 	}
 
-- 
1.9.1

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

                 reply	other threads:[~2016-09-01 13:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472737162-3507-1-git-send-email-jsarha@ti.com \
    --to=jsarha@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).