All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: Re: [PATCH] drm/xe/oa: Fix exec_queue leak on width check in stream open
Date: Thu, 14 May 2026 13:52:11 -0700	[thread overview]
Message-ID: <87mry1u32c.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20260514203210.593488-1-shuicheng.lin@intel.com>

On Thu, 14 May 2026 13:32:10 -0700, Shuicheng Lin wrote:
>
> In xe_oa_stream_open_ioctl(), when param.exec_q->width > 1 the
> function returns -EOPNOTSUPP directly, skipping the existing
> err_exec_q cleanup path. The exec_queue reference obtained by
> xe_exec_queue_lookup() is leaked.
>
> The exec queue holds a reference on the xe_file, which is only
> dropped during queue teardown. The leaked lookup ref is not on
> the file's exec_queue xarray, so file close cannot release it.
> This keeps both the exec queue and the file private state pinned
> indefinitely.
>
> Jump to err_exec_q instead of returning directly so the reference
> is released.
>
> Fixes: f0ed39830e60 ("xe/oa: Fix query mode of operation for OAR/OAC")
> Assisted-by: Claude:claude-opus-4.6
> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

> ---
> Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_oa.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
> index 7c9071abb44f..4bf4b1f65929 100644
> --- a/drivers/gpu/drm/xe/xe_oa.c
> +++ b/drivers/gpu/drm/xe/xe_oa.c
> @@ -2051,8 +2051,10 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
>		if (XE_IOCTL_DBG(oa->xe, !param.exec_q))
>			return -ENOENT;
>
> -		if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1))
> -			return -EOPNOTSUPP;
> +		if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1)) {
> +			ret = -EOPNOTSUPP;
> +			goto err_exec_q;
> +		}
>	}
>
>	/*
> --
> 2.43.0
>

  reply	other threads:[~2026-05-14 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 20:32 [PATCH] drm/xe/oa: Fix exec_queue leak on width check in stream open Shuicheng Lin
2026-05-14 20:52 ` Dixit, Ashutosh [this message]
2026-05-14 21:11 ` ✓ CI.KUnit: success for " Patchwork
2026-05-14 22:05 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-15 15:13 ` ✗ Xe.CI.FULL: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mry1u32c.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=shuicheng.lin@intel.com \
    --cc=umesh.nerlige.ramappa@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.