intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 16 Aug 2012 20:06:55 +0000 (22:06 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Fri, 17 Aug 2012 17:37:14 +0000 (19:37 +0200)
commit3735d524da64b70b41c764359da36f88aded3610
tree6545a0abb9fa053e7ccfeae4e43fd3172e651f65
parent5fbbb90dfdedb9a258550e4e5debd3013266372e
intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.

If the machine is booted without any cpu_idle driver set
(b/c disable_cpuidle() has been called) we should follow
other users of cpu_idle API and check the return value
for NULL before using it.

Reported-and-tested-by: Mark van Dijk <mark@internecto.net>
Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
drivers/idle/intel_idle.c