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

Zilin Guan zilin at seu.edu.cn
Sun Dec 28 08:21:49 PST 2025


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



More information about the linux-arm-kernel mailing list