alistair23-linux/drivers/idle
Richard Cochran ca42489d9e intel_idle: Avoid a double free of the per-CPU data.
The helper function, intel_idle_cpuidle_devices_uninit, frees the
globally allocated per-CPU data.  However, this function is invoked
from the hot plug notifier callback at a time when freeing that data
is not safe.

If the call to cpuidle_register_driver() should fail (say, due to lack
of memory), then the driver will free its per-CPU region.  On the
*next* CPU_ONLINE event, the driver will happily use the region again
and even free it again if the failure repeats.

This patch fixes the issue by moving the call to free_percpu() outside
of the helper function at the two call sites that actually need to
free the per-CPU data.

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>
2016-04-07 22:10:57 +02:00
..
i7300_idle.c intel_idle: Convert i7300_idle_lock to raw_spinlock 2013-02-19 08:42:47 +01:00
intel_idle.c intel_idle: Avoid a double free of the per-CPU data. 2016-04-07 22:10:57 +02:00
Kconfig drivers/idle: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:52:43 -08:00
Makefile intel_idle: native hardware cpuidle driver for latest Intel processors 2010-05-28 14:26:20 -04:00