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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 13:44:17 +0000 (06:44 -0700)
commit6535fb1535c0053ac22c2ed5c20b9465f30a523e
tree32297889e8152aef2e9ef1dc11bf3c18254cfbe8
parent23a5a7a2dafd877ec853b4c7debf6d726d10f9b9
intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.

commit 3735d524da64b70b41c764359da36f88aded3610 upstream.

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>
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/idle/intel_idle.c