Преглед на файлове

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>
Mark Brown преди 7 години
родител
ревизия
46589e9c75
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      drivers/base/regmap/regmap-debugfs.c

+ 3 - 1
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++;
 	}