summaryrefslogtreecommitdiffstats
path: root/drivers/idle
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-08-16 22:06:55 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2012-08-17 19:37:14 +0200
commit3735d524da64b70b41c764359da36f88aded3610 (patch)
tree6545a0abb9fa053e7ccfeae4e43fd3172e651f65 /drivers/idle
parentcpuidle: Prevent null pointer dereference in cpuidle_coupled_cpu_notify (diff)
downloadlinux-3735d524da64b70b41c764359da36f88aded3610.tar.xz
linux-3735d524da64b70b41c764359da36f88aded3610.zip
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>
Diffstat (limited to 'drivers/idle')
-rw-r--r--drivers/idle/intel_idle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index f559088869f6..e8726177d103 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -606,8 +606,9 @@ static int __init intel_idle_init(void)
intel_idle_cpuidle_driver_init();
retval = cpuidle_register_driver(&intel_idle_driver);
if (retval) {
+ struct cpuidle_driver *drv = cpuidle_get_driver();
printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
- cpuidle_get_driver()->name);
+ drv ? drv->name : "none");
return retval;
}