From: Dave Jones Date: Thu, 9 Mar 2006 03:12:00 +0000 (-0500) Subject: [ACPI] fix possible acpi thermal leak in failure path X-Git-Tag: v2.6.18-rc1~1081^2~19^2~13^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fdc136ccd3332938e989439c025c363f8479f3e6;p=linux-2.6-omap-h63xx.git [ACPI] fix possible acpi thermal leak in failure path Coverity: #601 Signed-off-by: Dave Jones Signed-off-by: Len Brown --- diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 19f3ea48475..d0b44ce2ec5 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -942,8 +942,10 @@ acpi_thermal_write_trip_points(struct file *file, 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"));