Skip to content

Commit af797b8

Browse files
mbrost05Lucas De Marchi
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: <stable@vger.kernel.org> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241105043524.4062774-2-matthew.brost@intel.com (cherry picked from commit 07064a2) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 1491efb commit af797b8

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

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)