drm: Fix property handling for mode object without object type
Subsystems (2)
RFC PATCH 1/1 drm: Fix property handling for mode object without object type
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 <[email protected]>
---
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(-)
drivers/gpu/drm/drm_property.c +3 -1
@@ -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 ; }
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel