public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it.
@ 2012-08-02 14:39 Konrad Rzeszutek Wilk
  2012-08-04 21:56 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-08-02 14:39 UTC (permalink / raw)
  To: lenb, linux-pm, linux-kernel; +Cc: Konrad Rzeszutek Wilk

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-by: Mark van Dijk <mark@internecto.net>
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>
---
 drivers/idle/intel_idle.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index f559088..7383aa0 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -607,7 +607,7 @@ static int __init intel_idle_init(void)
 	retval = cpuidle_register_driver(&intel_idle_driver);
 	if (retval) {
 		printk(KERN_DEBUG PREFIX "intel_idle yielding to %s",
-			cpuidle_get_driver()->name);
+			cpuidle_get_driver() ? cpuidle_get_driver()->name : "none");
 		return retval;
 	}
 
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-16 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-02 14:39 [PATCH] intel_idle: Check cpu_idle_get_driver() for NULL before dereferencing it Konrad Rzeszutek Wilk
2012-08-04 21:56 ` Rafael J. Wysocki
2012-08-06 14:33   ` Konrad Rzeszutek Wilk
2012-08-06 14:50   ` Konrad Rzeszutek Wilk
2012-08-16 20:19     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox