* [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww()
@ 2026-11-18 15:32 Haoxiang Li
2026-11-19 8:04 ` Joonas Lahtinen
2026-11-19 22:08 ` Andi Shyti
0 siblings, 2 replies; 5+ messages in thread
From: Haoxiang Li @ 2026-11-18 15:32 UTC (permalink / raw)
To: jani.nikula, joonas.lahtinen, rodrigo.vivi, tursulin, airlied, simona
Cc: intel-gfx, dri-devel, linux-kernel, Haoxiang Li
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww()
2026-11-18 15:32 [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww() Haoxiang Li
@ 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
1 sibling, 2 replies; 5+ messages in thread
From: Joonas Lahtinen @ 2026-11-19 8:04 UTC (permalink / raw)
To: Haoxiang Li, airlied, jani.nikula, rodrigo.vivi, simona, tursulin
Cc: intel-gfx, dri-devel, linux-kernel, Haoxiang Li
Quoting Haoxiang Li (2026-11-18 17:32:05)
> 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>
You seem to be spamming the different kernel subsystems with patches and
never respond to any feedback, so if you could just stop and do something
else.
Regards, Joonas
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww()
2026-11-19 8:04 ` Joonas Lahtinen
@ 2026-11-19 9:58 ` Haoxiang Li
2026-11-19 22:04 ` Andi Shyti
1 sibling, 0 replies; 5+ messages in thread
From: Haoxiang Li @ 2026-11-19 9:58 UTC (permalink / raw)
To: Joonas Lahtinen
Cc: airlied, jani.nikula, rodrigo.vivi, simona, tursulin, intel-gfx,
dri-devel, linux-kernel
At 2026-11-19 16:04:06, "Joonas Lahtinen" <joonas.lahtinen@linux.intel.com> wrote:
>
>You seem to be spamming the different kernel subsystems with patches and
>never respond to any feedback, so if you could just stop and do something
>else.
>
>Regards, Joonas
Hi Joonas,
I have been following up on review feedback. One example before your reply is:
https://lore.kernel.org/all/20261118102012.2252221-1-haoxiang_li2024@163.com/
I thought I should leave some time, such as 24 hours, between postings, so I not sent
those revisions immediately. I'll take your advice and stop, focusing on addressing
the feedback on my existing patches before submitting new ones.
Regards,
Haoxiang Li
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww()
2026-11-19 8:04 ` Joonas Lahtinen
2026-11-19 9:58 ` Haoxiang Li
@ 2026-11-19 22:04 ` Andi Shyti
1 sibling, 0 replies; 5+ messages in thread
From: Andi Shyti @ 2026-11-19 22:04 UTC (permalink / raw)
To: Joonas Lahtinen
Cc: Haoxiang Li, airlied, jani.nikula, rodrigo.vivi, simona,
tursulin, intel-gfx, dri-devel, linux-kernel
Hi Joonas,
On Thu, Nov 19, 2026 at 10:04:06AM +0200, Joonas Lahtinen wrote:
> Quoting Haoxiang Li (2026-11-18 17:32:05)
> > 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>
>
> You seem to be spamming the different kernel subsystems with patches and
> never respond to any feedback, so if you could just stop and do something
> else.
The patch is correct, though, and I'd take it.
If Haoxiang is not responding to other patches then bad for him
and I'd give the same suggestion as you did. But if we are not
taking this patch, then we would remain with a clear known
liability in our code.
Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww()
2026-11-18 15:32 [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww() Haoxiang Li
2026-11-19 8:04 ` Joonas Lahtinen
@ 2026-11-19 22:08 ` Andi Shyti
1 sibling, 0 replies; 5+ messages in thread
From: Andi Shyti @ 2026-11-19 22:08 UTC (permalink / raw)
To: Haoxiang Li
Cc: jani.nikula, joonas.lahtinen, rodrigo.vivi, tursulin, airlied,
simona, intel-gfx, dri-devel, linux-kernel
Hi Haoxiang,
On Wed, Nov 18, 2026 at 11:32:05PM +0800, Haoxiang Li wrote:
> 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")
that's weird to use the a merge commit as fixes, but that's what
it is.
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks,
Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-19 22:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 15:32 [PATCH] drm/i915/vma: Fix a memory leak in i915_vma_pin_ww() Haoxiang Li
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
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®