Verified Commit 17cf46cf authored by Jeffy Chen's avatar Jeffy Chen Committed by Mark Brown
Browse files

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: default avatarJeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
parent 46589e9c
......@@ -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;
}
......
Supports Markdown
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