diff options
author | Mark Brown <broonie@kernel.org> | 2018-03-05 15:26:51 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-03-05 15:26:51 -0500 |
commit | 46589e9c753b7c905e8671a89cbb9728f3b99855 (patch) | |
tree | 4204eb8982f3a19db7ae8e17ada05bfe414835b8 | |
parent | a430ab205d29e7d1537b220fcf989b8080d8267f (diff) |
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 <broonie@kernel.org>
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index e3e7b91cc421..dd3a16894e3c 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) | |||
575 | } | 575 | } |
576 | 576 | ||
577 | if (!strcmp(name, "dummy")) { | 577 | if (!strcmp(name, "dummy")) { |
578 | name = kasprintf(GFP_KERNEL, "dummy%d", dummy_index); | 578 | map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d", |
579 | dummy_index); | ||
580 | name = map->debugfs_name; | ||
579 | dummy_index++; | 581 | dummy_index++; |
580 | } | 582 | } |
581 | 583 | ||