[ACPI] fix possible acpi thermal leak in failure path

Coverity: #601

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Dave Jones 2006-03-08 22:12:00 -05:00 committed by Len Brown
parent a1f9e65e20
commit fdc136ccd3

View file

@ -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"));