Browse Source

Merge branch 'pm-cpuidle'

* pm-cpuidle:
  cpuidle: Check the result of cpuidle_get_driver() against NULL
Rafael J. Wysocki 12 years ago
parent
commit
1a7b0ecbbc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/cpuidle/driver.c

+ 2 - 1
drivers/cpuidle/driver.c

@@ -331,7 +331,8 @@ struct cpuidle_driver *cpuidle_driver_ref(void)
 	spin_lock(&cpuidle_driver_lock);
 
 	drv = cpuidle_get_driver();
-	drv->refcnt++;
+	if (drv)
+		drv->refcnt++;
 
 	spin_unlock(&cpuidle_driver_lock);
 	return drv;