未验证 提交 46589e9c 编写于 作者: M Mark Brown

regmap: debugfs: Don't leak dummy names

When allocating dummy names we need to store a pointer to the string we
allocate so that we don't leak it on free.
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 a430ab20
...@@ -575,7 +575,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name) ...@@ -575,7 +575,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
} }
if (!strcmp(name, "dummy")) { if (!strcmp(name, "dummy")) {
name = kasprintf(GFP_KERNEL, "dummy%d", dummy_index); map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d",
dummy_index);
name = map->debugfs_name;
dummy_index++; dummy_index++;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册