Skip to contentSkip to conversation

hwmon: (asus_atk0110) fix memory leak

PATCH In review Luca Tettamanti 2 participants 2 messages Jul 5, 2011 – Jul 6, 2011

Subsystems (2)
lore
Share & tools
lore

Luca Tettamanti

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (asus_atk0110) fix memory leak

The object returned by atk_gitm is dynamically allocated and must be freed.

---
 drivers/hwmon/asus_atk0110.c |    1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/asus_atk0110.c +1 -0
index dcb78a7..00e9851 100644
@@ -674,6 +674,7 @@ static int atk_debugfs_gitm_get(void *p, u64 *val)
 	else
 		err = -EIO;
 
+	ACPI_FREE(ret);
 	return err;
 }
 

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw
Quoted 14 lines · Luca Tettamanti

The object returned by atk_gitm is dynamically allocated and must be freed.

---
 drivers/hwmon/asus_atk0110.c |    1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/asus_atk0110.c +0 -0
index dcb78a7..00e9851 100644

drivers/hwmon/asus_atk0110.c static int atk_debugfs_gitm_get(void *p, u64 *val) · line 680

Quoted 7 lines
drivers/hwmon/asus_atk0110.c +1 -0
@@ -674,6 +674,7 @@ static int atk_debugfs_gitm_get(void *p, u64 *val)
 	else
 		err = -EIO;
 
+	ACPI_FREE(ret);
 	return err;
 }
 

Good catch. Applied, thanks!

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors