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: dd08ebf6c3 ("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 07064a200b40ac2195cb6b7b779897d9377e5e6f)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
committed by
Lucas De Marchi
parent
1491efb39a
commit
af797b831d
@@ -132,12 +132,16 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
|
||||
if (XE_IOCTL_DBG(xe, !q))
|
||||
return -ENOENT;
|
||||
|
||||
if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM))
|
||||
return -EINVAL;
|
||||
if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM)) {
|
||||
err = -EINVAL;
|
||||
goto err_exec_queue;
|
||||
}
|
||||
|
||||
if (XE_IOCTL_DBG(xe, args->num_batch_buffer &&
|
||||
q->width != args->num_batch_buffer))
|
||||
return -EINVAL;
|
||||
q->width != args->num_batch_buffer)) {
|
||||
err = -EINVAL;
|
||||
goto err_exec_queue;
|
||||
}
|
||||
|
||||
if (XE_IOCTL_DBG(xe, q->ops->reset_status(q))) {
|
||||
err = -ECANCELED;
|
||||
|
||||
Reference in New Issue
Block a user