diff --git a/xf86drmMode.c b/xf86drmMode.c index 529429e8..fa219861 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -1289,7 +1289,7 @@ static int sort_req_list(const void *misc, const void *other) int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, uint32_t flags, void *user_data) { - drmModeAtomicReqPtr sorted = drmModeAtomicDuplicate(req); + drmModeAtomicReqPtr sorted; struct drm_mode_atomic atomic; uint32_t *objs_ptr = NULL; uint32_t *count_props_ptr = NULL; @@ -1300,7 +1300,11 @@ int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, uint32_t flags, int obj_idx = -1; int ret = -1; - if (!sorted) + if (req->cursor == 0) + return 0; + + sorted = drmModeAtomicDuplicate(req); + if (sorted == NULL) return -ENOMEM; memclear(atomic);