diff options
Diffstat (limited to 'drivers/acpi')
-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 19f3ea48475e..d0b44ce2ec5a 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -942,8 +942,10 @@ acpi_thermal_write_trip_points(struct file *file, | |||
942 | memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN); | 942 | memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN); |
943 | 943 | ||
944 | active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL); | 944 | active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL); |
945 | if (!active) | 945 | if (!active) { |
946 | kfree(limit_string); | ||
946 | return_VALUE(-ENOMEM); | 947 | return_VALUE(-ENOMEM); |
948 | } | ||
947 | 949 | ||
948 | if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) { | 950 | if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) { |
949 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); | 951 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); |