drm/atomic: Refuse to add invalid objects to requests
PATCH 1/1 drm/atomic: Refuse to add invalid objects to requests
Object and property IDs cannot be zero. Prevent them from being added to the request stream at all, rather than breaking at commit time.
--- xf86drmMode.c | 3 +++ 1 file changed, 3 insertions(+)
xf86drmMode.c +3 -0
@@ -1313,6 +1313,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,if (!req)return -EINVAL ; +if (object_id ==0 || property_id ==0 ) +return -EINVAL ; +if (req->cursor >= req->size_items) {drmModeAtomicReqItemPtr new;
Signature · 6 lines
2.14.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 13 lines · Daniel Stone
Object and property IDs cannot be zero. Prevent them from being added to the request stream at all, rather than breaking at commit time.
Signed-off-by Daniel Stone <[email protected]>--- xf86drmMode.c | 3 +++ 1 file changed, 3 insertions(+)xf86drmMode.c +0
-0
xf86drmMode.c int drmModeAtomicAddProperty(drmModeAtomicReqPtr req, · line 1317
Quoted 5 lines
xf86drmMode.c +2
-0@@ -1313,6 +1313,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,if (!req)return -EINVAL ; +if (object_id ==0 || property_id ==0 ) +return -EINVAL ;
... and gives us a perfect spot to gdb into a backtrace and figure out wtf is going on with drm_hwc :-)
-Daniel
Quoted 11 lines
xf86drmMode.c +1
-0+if (req->cursor >= req->size_items) {drmModeAtomicReqItemPtr new;Signature · 6 lines
2.14.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Daniel Vetter
Quoted 2 lines · Daniel Stone
Object and property IDs cannot be zero. Prevent them from being added to the request stream at all, rather than breaking at commit time.
Reviewed-by Daniel Vetter <[email protected]>... and gives us a perfect spot to gdb into a backtrace and figure out wtf is going on with
drm_hwc:-)
Heh, and pushed now. Thanks Daniel!
Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel