]> git.baikalelectronics.ru Git - kernel.git/commit
intel_idle: Fix deallocation order on the driver exit path.
authorRichard Cochran <rcochran@linutronix.de>
Wed, 6 Apr 2016 21:00:51 +0000 (17:00 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Apr 2016 20:10:54 +0000 (22:10 +0200)
commit8d3aa89497cc2dca9c42780a4361d128791093fe
treec5dd73b8ab2e6337b7b10d5b76ee66b68dd5d566
parent1dae163c43e1a6812a87cd65796840db68b031ec
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>
drivers/idle/intel_idle.c