Thread (3 messages) 3 messages, 2 authors, 2025-12-28

Re: [PATCH] soc: mediatek: SVS: Fix memory leak in svs_enable_debug_write()

From: Zilin Guan <hidden>
Date: 2025-12-28 17:37:28
Also in: linux-mediatek, lkml

On Sun, Dec 28, 2025 at 03:19:00PM+0100, Markus Elfring wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help