* [PATCH RFC] drm: Fix property handling for mode object without object type
@ 2016-09-01 13:39 Jyri Sarha
0 siblings, 0 replies; only message in thread
From: Jyri Sarha @ 2016-09-01 13:39 UTC (permalink / raw)
To: dri-devel; +Cc: tomi.valkeinen, Jyri Sarha, laurent.pinchart
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-01 13:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 13:39 [PATCH RFC] drm: Fix property handling for mode object without object type Jyri Sarha
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).