diff options
author | Dave Jones <davej@redhat.com> | 2006-03-09 03:12:00 (GMT) |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-03-31 06:02:39 (GMT) |
commit | fdc136ccd3332938e989439c025c363f8479f3e6 (patch) | |
tree | 6e71b49f8b1ed92fe0c51984e27379acdf2991c3 /drivers/acpi/thermal.c | |
parent | a1f9e65e2085e0a87f28a4d5a8ae43b32c087f24 (diff) | |
download | linux-fsl-qoriq-fdc136ccd3332938e989439c025c363f8479f3e6.tar.xz |
[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>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | drivers/acpi/thermal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 19f3ea4..d0b44ce 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")); |