]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 3 Nov 2016 17:25:35 +0000 (10:25 -0700)
commit7bf662673264102ebbfc2648677b89a2fa0f759b
tree07ee51d99f9218a650ebf2381d7092998d35f4bc
parenta042a9718f6bd7771b8911b0d6111fb1484c6312
intel_idle: Fix deallocation order on the driver exit path.

Orabug: 24810432

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>
(cherry picked from commit 51319918bcc31f901646fc66348d41cf74ee0566)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/idle/intel_idle.c