Re: [PATCH] mfd: syscon: free the allocated name field of struct regmap_config

From: Lee Jones
Date: Wed May 19 2021 - 08:05:14 EST


On Wed, 07 Apr 2021, Meng.Li@xxxxxxxxxxxxx wrote:

> From: Limeng <Meng.Li@xxxxxxxxxxxxx>
>
> The commit 529a1101212a("mfd: syscon: Don't free allocated name
> for regmap_config") doesn't free the allocated name field of struct
> regmap_config, but introduce a memory leak. There is another
> commit 94cc89eb8fa5("regmap: debugfs: Fix handling of name string
> for debugfs init delays") fixing this debugfs init issue from root
> cause. With this fixing, the name field in struct regmap_debugfs_node
> is removed. When initialize debugfs for syscon driver, the name
> field of struct regmap_config is not used anymore. So, the allocated
> name field of struct regmap_config is need to be freed directly after
> regmap initialization to avoid memory leak.
>
> Fixes: 529a1101212a("mfd: syscon: Don't free allocated name for regmap_config")
> Cc: Marc Zyngier <maz@xxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Meng Li <Meng.Li@xxxxxxxxxxxxx>
> ---
> drivers/mfd/syscon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog