Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / thermal: fix workqueue destroy order

When the thermal module is to be removed, we should destroy the wq
acpi_thermal_pm_queue after the ACPI driver's remove callback is
executed as we will need to flush the workqueue there, or a NULL pointer
access will be hit.

Reported-and-tested-by: Kui Zhang <kuizhang@gmail.com>
References: http://www.spinics.net/lists/kernel/msg1747251.html
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Aaron Lu and committed by
Rafael J. Wysocki
2807bd18 4b660a7f

+1 -1
+1 -1
drivers/acpi/thermal.c
··· 1278 1278 1279 1279 static void __exit acpi_thermal_exit(void) 1280 1280 { 1281 - destroy_workqueue(acpi_thermal_pm_queue); 1282 1281 acpi_bus_unregister_driver(&acpi_thermal_driver); 1282 + destroy_workqueue(acpi_thermal_pm_queue); 1283 1283 1284 1284 return; 1285 1285 }