mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
intel_idle: Fix deallocation order on the driver exit path.
In the module_exit() method, this driver first frees its per-CPU pointer, then unregisters a callback making use of the pointer. Furthermore, the function, intel_idle_cpuidle_devices_uninit, is racy against CPU hot plugging as it calls for_each_online_cpu(). This patch corrects the issues by unregistering first on the exit path while holding the hot plug lock. Signed-off-by: Richard Cochran <rcochran@linutronix.de> Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
4a3dfb3fc0
commit
51319918bc
1 changed files with 3 additions and 3 deletions
|
@ -1242,16 +1242,16 @@ static int __init intel_idle_init(void)
|
||||||
|
|
||||||
static void __exit intel_idle_exit(void)
|
static void __exit intel_idle_exit(void)
|
||||||
{
|
{
|
||||||
intel_idle_cpuidle_devices_uninit();
|
|
||||||
cpuidle_unregister_driver(&intel_idle_driver);
|
|
||||||
|
|
||||||
cpu_notifier_register_begin();
|
cpu_notifier_register_begin();
|
||||||
|
|
||||||
if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE)
|
if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE)
|
||||||
on_each_cpu(__setup_broadcast_timer, (void *)false, 1);
|
on_each_cpu(__setup_broadcast_timer, (void *)false, 1);
|
||||||
__unregister_cpu_notifier(&cpu_hotplug_notifier);
|
__unregister_cpu_notifier(&cpu_hotplug_notifier);
|
||||||
|
intel_idle_cpuidle_devices_uninit();
|
||||||
|
|
||||||
cpu_notifier_register_done();
|
cpu_notifier_register_done();
|
||||||
|
|
||||||
|
cpuidle_unregister_driver(&intel_idle_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(intel_idle_init);
|
module_init(intel_idle_init);
|
||||||
|
|
Loading…
Reference in a new issue