From 46589e9c753b7c905e8671a89cbb9728f3b99855 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 5 Mar 2018 20:26:51 +0000 Subject: 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: Mark Brown --- drivers/base/regmap/regmap-debugfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/base') diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index e3e7b91..dd3a168 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -575,7 +575,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name) } 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++; } -- cgit v1.1