未验证 提交 17cf46cf 编写于 作者: J Jeffy Chen 提交者: Mark Brown

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: NJeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册