Skip to content

Commit

Permalink
intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Konrad Rzeszutek Wilk authored and Rafael J. Wysocki committed Aug 17, 2012
1 parent 5fbbb90 commit 3735d52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/idle/intel_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3735d52

Please sign in to comment.