aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-11-04 07:54:21 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2023-11-04 07:54:21 -1000
commit3062a9879afbca810d9f1613698963ecfcb35701 (patch)
tree99525579b09e59c54a19f018b12edffa5911a326
parentMerge tag 'pinctrl-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl (diff)
parentACPI: thermal: Fix acpi_thermal_unregister_thermal_zone() cleanup (diff)
downloadwireguard-linux-3062a9879afbca810d9f1613698963ecfcb35701.tar.xz
wireguard-linux-3062a9879afbca810d9f1613698963ecfcb35701.zip
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
-rw-r--r--drivers/acpi/thermal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index d98ff69303b3..f74d81abdbfc 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -702,9 +702,9 @@ unregister_tzd:
static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
{
+ thermal_zone_device_disable(tz->thermal_zone);
acpi_thermal_zone_sysfs_remove(tz);
thermal_zone_device_unregister(tz->thermal_zone);
- kfree(tz->trip_table);
tz->thermal_zone = NULL;
}
@@ -967,7 +967,7 @@ static void acpi_thermal_remove(struct acpi_device *device)
flush_workqueue(acpi_thermal_pm_queue);
acpi_thermal_unregister_thermal_zone(tz);
-
+ kfree(tz->trip_table);
acpi_thermal_free_thermal_zone(tz);
}