aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Stone2018-03-07 06:41:12 -0600
committerDaniel Stone2018-03-07 11:19:29 -0600
commit45eee3fd44f4fa253cd4d5c03f48d4a6899f899f (patch)
tree54f631ac78482067f97c5c7cbc107791b7b6bd40 /xf86drmMode.c
parent7b12381723021fd5fbcf761e6832dd16a14f52d4 (diff)
downloadexternal-libgbm-45eee3fd44f4fa253cd4d5c03f48d4a6899f899f.tar.gz
external-libgbm-45eee3fd44f4fa253cd4d5c03f48d4a6899f899f.tar.xz
external-libgbm-45eee3fd44f4fa253cd4d5c03f48d4a6899f899f.zip
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>
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 15957ffc..bd59ef25 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -1313,6 +1313,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,
1313 if (!req) 1313 if (!req)
1314 return -EINVAL; 1314 return -EINVAL;
1315 1315
1316 if (object_id == 0 || property_id == 0)
1317 return -EINVAL;
1318
1316 if (req->cursor >= req->size_items) { 1319 if (req->cursor >= req->size_items) {
1317 drmModeAtomicReqItemPtr new; 1320 drmModeAtomicReqItemPtr new;
1318 1321