Skip to content

Commit

Permalink
[ACPI] fix possible acpi thermal leak in failure path
Browse files Browse the repository at this point in the history
Coverity: #601

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Dave Jones authored and Len Brown committed Mar 31, 2006
1 parent a1f9e65 commit fdc136c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit fdc136c

Please sign in to comment.