|
@@ -941,8 +941,10 @@ acpi_thermal_write_trip_points(struct file *file,
|
|
memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
|
|
memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
|
|
|
|
|
|
active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
|
|
active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
|
|
- if (!active)
|
|
|
|
|
|
+ if (!active) {
|
|
|
|
+ kfree(limit_string);
|
|
return_VALUE(-ENOMEM);
|
|
return_VALUE(-ENOMEM);
|
|
|
|
+ }
|
|
|
|
|
|
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
|
|
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
|
|
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
|
|
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
|