OpenVZ Forum


Home » Mailing lists » Devel » [PATCH ACPI] memory leakages in drivers/acpi/thermal.c
[PATCH ACPI] memory leakages in drivers/acpi/thermal.c [message #2544] Sun, 09 April 2006 15:05
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
acpi_thermal_write_trip_points() and acpi_thermal_add() do not call kfree() for
allocated memory on the error path.

Signed-off-by: Vasily Averin <vvs@sw.ru>

Thank you,
Vasily Averin

SWsoft Virtuozzo/OpenVZ Linux kernel team

--- a/drivers/acpi/thermal.c 2006-04-09 17:03:50.000000000 +0400
+++ b/drivers/acpi/thermal.c 2006-04-09 17:46:41.000000000 +0400
@@ -942,8 +942,10 @@ acpi_thermal_write_trip_points(struct fi
memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);

active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
- if (!active)
+ if (!active) {
+ kfree(limit_string);
return_VALUE(-ENOMEM);
+ }

if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
@@ -1342,7 +1344,7 @@ static int acpi_thermal_add(struct acpi_

result = acpi_thermal_add_fs(device);
if (result)
- return_VALUE(result);
+ goto end;

init_timer(&tz->timer);
Previous Topic: [PATCH ACPI] memory leak in acpi_evaluate_integer()
Next Topic: [PATCH 0/7] uts namespaces: Introduction
Goto Forum:
  


Current Time: Thu Aug 21 19:41:19 GMT 2025

Total time taken to generate the page: 0.06214 seconds