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

From: Markus Elfring
Date: Sun Dec 28 2025 - 09:19:25 EST



> 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