Skip to content
Unverified Commit e41a962f authored by Meng Li's avatar Meng Li Committed by Mark Brown
Browse files

regmap: set debugfs_name to NULL after it is freed

There is a upstream commit cffa4b21("regmap:debugfs:
Fix a memory leak when calling regmap_attach_dev") that
adds a if condition when create name for debugfs_name.
With below function invoking logical, debugfs_name is
freed in regmap_debugfs_exit(), but it is not created again
because of the if condition introduced by above commit.
regmap_reinit_cache()
	regmap_debugfs_exit()
	...
	regmap_debugfs_init()
So, set debugfs_name to NULL after it is freed.

Fixes: cffa4b21

 ("regmap: debugfs: Fix a memory leak when calling regmap_attach_dev")
Signed-off-by: default avatarMeng Li <Meng.Li@windriver.com>
Link: https://lore.kernel.org/r/20210226021737.7690-1-Meng.Li@windriver.com
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a38fd874
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment