Commit 3735d524 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk Committed by Rafael J. Wysocki

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: default avatarMark van Dijk <mark@internecto.net>
Suggested-by: default avatarJan Beulich <JBeulich@suse.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 5fbbb90d
...@@ -606,8 +606,9 @@ static int __init intel_idle_init(void) ...@@ -606,8 +606,9 @@ static int __init intel_idle_init(void)
intel_idle_cpuidle_driver_init(); intel_idle_cpuidle_driver_init();
retval = cpuidle_register_driver(&intel_idle_driver); retval = cpuidle_register_driver(&intel_idle_driver);
if (retval) { if (retval) {
struct cpuidle_driver *drv = cpuidle_get_driver();
printk(KERN_DEBUG PREFIX "intel_idle yielding to %s", printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
cpuidle_get_driver()->name); drv ? drv->name : "none");
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment