[Quantal][PATCH 1/1] UBUNTU: SAUCE: cpuidle: Fix NULL pointer dereference when off-lining CPU's

leann.ogasawara at canonical.com leann.ogasawara at canonical.com
Fri Apr 12 17:05:15 UTC 2013


From: Leann Ogasawara <leann.ogasawara at canonical.com>

BugLink: http://bugs.launchpad.net/bugs/1168452

When off-lining CPU's on some multi-processor systems (eg. DL385p Gen 8)
we hit a NULL pointer dereference kernel oops.  This is resolved by
checking the device pointer prior to it ever being used.

Signed-off-by: Leann Ogasawara <leann.ogasawara at canonical.com>
---
 drivers/cpuidle/cpuidle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d90519c..dd4816b 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -72,7 +72,7 @@ int cpuidle_play_dead(void)
 	int i, dead_state = -1;
 	int power_usage = -1;
 
-	if (!drv)
+	if (!drv || !dev)
 		return -ENODEV;
 
 	/* Find lowest-power state that supports long-term idle */
-- 
1.8.1.2





More information about the kernel-team mailing list