mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
cpuidle: Check the result of cpuidle_get_driver() against NULL
If the current CPU has no cpuidle driver, drv will be NULL in cpuidle_driver_ref(). Check if that is the case before trying to bump up the driver's refcount to prevent the kernel from crashing. [rjw: Subject and changelog] Signed-off-by: Daniel Fu <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
9e19b73c30
commit
3b9c10e980
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue