Skip to content

Commit 1b5d0dd

Browse files
committed
drm/msm: Disallow submit with fence id 0
A fence id of zero is expected to be invalid, and is not removed from the fence_idr table. If userspace is requesting to specify the fence id with the FENCE_SN_IN flag, we need to reject a zero fence id value. Fixes: 17154ad ("drm/msm: Add MSM_SUBMIT_FENCE_SN_IN") Signed-off-by: Rob Clark <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/549180/
1 parent 1cd0787 commit 1b5d0dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/msm/msm_gem_submit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
901901
* after the job is armed
902902
*/
903903
if ((args->flags & MSM_SUBMIT_FENCE_SN_IN) &&
904-
idr_find(&queue->fence_idr, args->fence)) {
904+
(!args->fence || idr_find(&queue->fence_idr, args->fence))) {
905905
spin_unlock(&queue->idr_lock);
906906
idr_preload_end();
907907
ret = -EINVAL;

0 commit comments

Comments
 (0)