[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251228162149.3825287-1-zilin@seu.edu.cn>
Date: Sun, 28 Dec 2025 16:21:49 +0000
From: Zilin Guan <zilin@....edu.cn>
To: markus.elfring@....de
Cc: angelogioacchino.delregno@...labora.com,
jianhao.xu@....edu.cn,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
matthias.bgg@...il.com,
zilin@....edu.cn
Subject: Re: [PATCH] soc: mediatek: SVS: Fix memory leak in svs_enable_debug_write()
On Sun, Dec 28, 2025 at 03:19:00PM+0100, Markus Elfring wrote:
> …
> > Fix this by freeing buf before returning the error code.
>
> How do you think about to use the attribute “__free(kfree)”?
> https://elixir.bootlin.com/linux/v6.19-rc2/source/include/linux/slab.h#L512
> https://elixir.bootlin.com/linux/v6.19-rc2/source/drivers/soc/mediatek/mtk-svs.c#L785-L813
>
> Regards,
> Markus
Hi Markus,
Thanks for the suggestion.
I agree that using the "__free(kfree)" attribute is a good way to
simplify memory management here. I will apply this change in the
v2 patch.
Regards,
Zilin Guan
Powered by blists - more mailing lists