Re: [PATCH v2] drm/i915: Use symmetric free for vma resources

From: Andi Shyti

Date: Tue Nov 18 2025 - 09:04:54 EST


Hi Zilin,

On Thu, Nov 13, 2025 at 06:34:05AM +0000, Zilin Guan wrote:
> The error paths in reserve_gtt_with_resource() and
> insert_gtt_with_resource() use kfree() to release a vma_res object
> that was allocated with i915_vma_resource_alloc().
>
> While kfree() can handle slab-allocated objects, it is better practice
> to use the symmetric free function.
>
> Replace kfree() with the specific i915_vma_resource_free() helper to
> improve readability and ensure the alloc/free pairing is explicit.
>
> Signed-off-by: Zilin Guan <zilin@xxxxxxxxxx>

Thanks for your patch,

Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>

Andi