Skip to content

Commit af797b8

Browse files
mbrost05lucasdemarchi
authored andcommitted
drm/xe: Fix possible exec queue leak in exec IOCTL
In a couple of places after an exec queue is looked up the exec IOCTL returns on input errors without dropping the exec queue ref. Fix this ensuring the exec queue ref is dropped on input error. Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: <[email protected]> Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: Tejas Upadhyay <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 07064a2) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 1491efb commit af797b8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
132132
if (XE_IOCTL_DBG(xe, !q))
133133
return -ENOENT;
134134

135-
if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM))
136-
return -EINVAL;
135+
if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM)) {
136+
err = -EINVAL;
137+
goto err_exec_queue;
138+
}
137139

138140
if (XE_IOCTL_DBG(xe, args->num_batch_buffer &&
139-
q->width != args->num_batch_buffer))
140-
return -EINVAL;
141+
q->width != args->num_batch_buffer)) {
142+
err = -EINVAL;
143+
goto err_exec_queue;
144+
}
141145

142146
if (XE_IOCTL_DBG(xe, q->ops->reset_status(q))) {
143147
err = -ECANCELED;

0 commit comments

Comments
 (0)