Re: [PATCH] platform/x86/amd: Fix memory leak in wbrf_record()
From: Zilin Guan
Date: Sat Jan 03 2026 - 07:17:38 EST
On Fri, Jan 02, 2026 at 01:29:20PM +0200, "Ilpo Järvinen" wrote:
> Hi,
>
> Lets not get too attached to the ways of the past, using __free() is
> what we want to use even as a fix here. Adding goto labels adds
> complexity, not reduces it, so I don't buy the easier backport argument
> (on backport each goto target should be carefully reviewed which is
> something __free() does not require because it simply is better
> interface).
>
> You just need to remember to move also the variable declaration down to
> the alloc site as per the guidance in cleanup.h.
Hi Ilpo,
Thanks for the feedback. I agree that using __free() is a better approach
here to reduce complexity. I have updated the patch to use scope-based
resource management and will send a v2 shortly.
Best regards,
Zilin Guan