Skip to contentSkip to conversation

arm: mach-omap2: voltage: debugfs: fix memory leak

PATCH New Aaro Koskinen 2 participants 2 messages Jan 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mach-omap2: voltage: debugfs: fix memory leak

The temporary string holding the directory name to be created should be released.

---
 arch/arm/mach-omap2/voltage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/voltage.c +1 -0
index ed6079c..12be525 100644
@@ -471,6 +471,7 @@ static void __init vdd_debugfs_init(struct omap_vdd_info *vdd)
 	strcat(name, vdd->voltdm.name);
 
 	vdd->debug_dir = debugfs_create_dir(name, voltage_dir);
+	kfree(name);
 	if (IS_ERR(vdd->debug_dir)) {
 		pr_warning("%s: Unable to create debugfs directory for"
 			" vdd_%s\n", __func__, vdd->voltdm.name);
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 arm: mach-omap2: voltage: debugfs: fix memory leak

Quoted 4 lines · Aaro Koskinen

The temporary string holding the directory name to be created should be released.

Thanks, queuing in pm-fixes for 2.6.38.

Kevin

Quoted 16 lines
---
 arch/arm/mach-omap2/voltage.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/voltage.c +1 -0
index ed6079c..12be525 100644
@@ -471,6 +471,7 @@ static void __init vdd_debugfs_init(struct omap_vdd_info *vdd)
 	strcat(name, vdd->voltdm.name);
 
 	vdd->debug_dir = debugfs_create_dir(name, voltage_dir);
+	kfree(name);
 	if (IS_ERR(vdd->debug_dir)) {
 		pr_warning("%s: Unable to create debugfs directory for"
 			" vdd_%s\n", __func__, vdd->voltdm.name);