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.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
main
Daniel Stone 2018-03-07 12:41:12 +00:00
parent 7b12381723
commit 45eee3fd44
1 changed files with 3 additions and 0 deletions

View File

@ -1313,6 +1313,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,
if (!req) if (!req)
return -EINVAL; return -EINVAL;
if (object_id == 0 || property_id == 0)
return -EINVAL;
if (req->cursor >= req->size_items) { if (req->cursor >= req->size_items) {
drmModeAtomicReqItemPtr new; drmModeAtomicReqItemPtr new;