Re: [PATCH v2] drm/i915: fix kref leak in __live_active_setup error path
From: Joonas Lahtinen
Date: Mon Jun 29 2026 - 09:13:59 EST
Quoting WenTao Liang (2026-06-28 17:03:27)
> When heap_fence_create fails, the early error path calls kfree(active)
> directly instead of __live_put(active), bypassing the kref_put path that
> would call i915_active_fini for proper resource teardown. This skips
> cleanup of the i915_active state while the initial kref from kref_init
> remains unbalanced.
Is this AI generated? It hardly makes sense. The object was just allocated
and initialized, unbalanced kref which will be freed is not going to be
issue here at all.
Did you actually look at i915_active_fini?
Real reason to fix this would be to avoid the debug_object tracking to
get out of sync. That should be in the commit message and not some
generic high level description that can be read from the code
change itself.
> Suggested-by: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
> Fixes: 5361db1a33c7 ("drm/i915: Track i915_active using debugobjects")
> Cc: stable@xxxxxxxxxxxxxxx
In any case, we wouldn't put Fixes and especially not Cc: stable code
for selftests which need special Kconfig to build and modparams to run.
Regards, Joonas