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>
This commit is contained in:
Mark Brown 2018-03-05 20:26:51 +00:00
parent a430ab205d
commit 46589e9c75
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -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++;
}