Skip to content

Commit

Permalink
ACPI / thermal: fix workqueue destroy order
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aaron Lu authored and Rafael J. Wysocki committed May 26, 2014
1 parent 4b660a7 commit 2807bd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,8 @@ static int __init acpi_thermal_init(void)

static void __exit acpi_thermal_exit(void)
{
destroy_workqueue(acpi_thermal_pm_queue);
acpi_bus_unregister_driver(&acpi_thermal_driver);
destroy_workqueue(acpi_thermal_pm_queue);

return;
}
Expand Down

0 comments on commit 2807bd1

Please sign in to comment.