regmap: debugfs: Free map->debugfs_name when debugfs_create_dir() failed
Free map->debugfs_name when debugfs_create_dir() failed to avoid memory leak. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
46589e9c75
commit
17cf46cfe9
|
@ -584,6 +584,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
|
|||
map->debugfs = debugfs_create_dir(name, regmap_debugfs_root);
|
||||
if (!map->debugfs) {
|
||||
dev_warn(map->dev, "Failed to create debugfs directory\n");
|
||||
|
||||
kfree(map->debugfs_name);
|
||||
map->debugfs_name = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue