Skip to content

Commit 3062a98

Browse files
committed
Merge tag 'acpi-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fix from Rafael Wysocki: "Fix the acpi_thermal_add() error path that may do a double-free in some cases after recent changes (Dan Carpenter)" * tag 'acpi-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: thermal: Fix acpi_thermal_unregister_thermal_zone() cleanup
2 parents 90b0c2b + 4b27d5c commit 3062a98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz,
702702

703703
static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
704704
{
705+
thermal_zone_device_disable(tz->thermal_zone);
705706
acpi_thermal_zone_sysfs_remove(tz);
706707
thermal_zone_device_unregister(tz->thermal_zone);
707-
kfree(tz->trip_table);
708708
tz->thermal_zone = NULL;
709709
}
710710

@@ -967,7 +967,7 @@ static void acpi_thermal_remove(struct acpi_device *device)
967967

968968
flush_workqueue(acpi_thermal_pm_queue);
969969
acpi_thermal_unregister_thermal_zone(tz);
970-
970+
kfree(tz->trip_table);
971971
acpi_thermal_free_thermal_zone(tz);
972972
}
973973

0 commit comments

Comments
 (0)