From: lyude@redhat.com
To: Wentao Liang <vulab@iscas.ac.cn>, airlied@gmail.com
Cc: bskeggs@redhat.com, dakr@kernel.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
nouveau@lists.freedesktop.org, simona@ffwll.ch,
tzimmermann@suse.de, stable@vger.kernel.org
Subject: Re: [PATCH] drm/nouveau: Fix gem reference leak in validate_init()
Date: Thu, 17 Sep 2026 14:19:29 -0400 [thread overview]
Message-ID: <d43ff56c010c83fc4cbef634e7a632940f5d20f7.camel@redhat.com> (raw)
In-Reply-To: <20260916180202.2090231-1-vulab@iscas.ac.cn>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Will push to drm-misc-fixes in a bit
On Wed, 2026-09-16 at 18:02 +0000, Wentao Liang wrote:
> On the ttm_bo_reserve() failure and "vma not found" error paths, the
> loop breaks without adding the looked-up object to any validate list,
> so the reference taken by drm_gem_object_lookup() is never released;
> validate_fini() only walks the spliced lists. Drop the reference
> before breaking out on both paths.
>
> Fixes: 19ca10d82e33bcfe ("drm/nouveau/gem: lookup VMAs for buffers
> referenced by pushbuf ioctl")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/gpu/drm/nouveau/nouveau_gem.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c
> b/drivers/gpu/drm/nouveau/nouveau_gem.c
> index 20dba02d6175..c2601b559947 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
> @@ -513,6 +513,7 @@ validate_init(struct nouveau_channel *chan,
> struct drm_file *file_priv,
> if (unlikely(ret)) {
> if (ret != -ERESTARTSYS)
> NV_PRINTK(err, cli, "fail
> reserve\n");
> + drm_gem_object_put(gem);
> break;
> }
> }
> @@ -522,6 +523,7 @@ validate_init(struct nouveau_channel *chan,
> struct drm_file *file_priv,
> struct nouveau_vma *vma =
> nouveau_vma_find(nvbo, vmm);
> if (!vma) {
> NV_PRINTK(err, cli, "vma not
> found!\n");
> + drm_gem_object_put(gem);
> ret = -EINVAL;
> break;
> }
prev parent reply other threads:[~2026-09-17 18:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 18:02 Wentao Liang
2026-09-17 18:19 ` lyude [this message]
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=d43ff56c010c83fc4cbef634e7a632940f5d20f7.camel@redhat.com \
--to=lyude@redhat.com \
--cc=airlied@gmail.com \
--cc=bskeggs@redhat.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
--cc=vulab@iscas.ac.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®