Re: [PATCH v2] platform/x86/amd: Fix memory leak in wbrf_record()
From: Zilin Guan
Date: Tue Jan 06 2026 - 04:11:24 EST
On Mon, Jan 05, 2026 at 03:52:14PM +0200, "Ilpo Järvinen" wrote:
> While I'm certainly not against in converting also 'obj', this patch
> should be split to two, where the first patch fixes the case that is
> current lacking kfree(), and the second that does convert 'obj'. IIRC, on
> can just use kfree() directly for releasing it so adding the new
> DEFINE_FREE() doesn't seem necessary.
Hi Ilpo,
Thanks for your review.
I will follow your suggestion to split the patch into two in v3.
Just for context, the reason I modified 'obj' in v2 is to avoid mixing
goto-based cleanup with scope-based cleanup, as recommended in
cleanup.h [1]. This was also why I stuck to goto in v1
(to avoid touching 'obj').
[1] https://elixir.bootlin.com/linux/v6.19-rc4/source/include/linux/cleanup.h#L148-L153
Best regards,
Zilin Guan