mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haoxiang Li <haoxiang_li2024@163.com>
To: jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com, tursulin@ursulin.net, airlied@gmail.com,
	simona@ffwll.ch
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Haoxiang Li <haoxiang_li2024@163.com>
Subject: [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww()
Date: Wed, 18 Nov 2026 23:32:05 +0800	[thread overview]
Message-ID: <20261118153205.2432736-1-haoxiang_li2024@163.com> (raw)

i915_vma_pin_ww() allocates bind work before retrieving the object's
moving fence. If the lookup fails, it jumps to err_rpm, bypassing the
fence commit at err_fence and leaking the work allocation.

Jump to err_fence instead so the fence callbacks can release the work.

Fixes: 8ec5c0006c50 ("Merge tag 'drm-intel-next-2022-05-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-gt-next")
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 16782d8579a8..4ba1c9ea5ecb 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1470,7 +1470,7 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,
 
 		err = i915_gem_object_get_moving_fence(vma->obj, &moving);
 		if (err)
-			goto err_rpm;
+			goto err_fence;
 
 		dma_fence_work_chain(&work->base, moving);
 
-- 
2.25.1


             reply	other threads:[~2026-11-18 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 15:32 Haoxiang Li [this message]
2026-11-19  8:04 ` Joonas Lahtinen
2026-11-19  9:58   ` Haoxiang Li
2026-11-19 22:04   ` Andi Shyti
2026-11-19 22:08 ` Andi Shyti
2026-11-20  9:59 ` Andi Shyti
2026-11-21  7:24   ` Haoxiang Li

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=20261118153205.2432736-1-haoxiang_li2024@163.com \
    --to=haoxiang_li2024@163.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=tursulin@ursulin.net \
    /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®