mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
cpuidle: lpm-levels: Check for valid pointer during hotplug notifications
get_cpu_device() can return NULL. Add valid pointer check during hotplug notifications. Change-Id: I28234ed609fa45a770bb01203f7b5523532088e7 Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
This commit is contained in:
parent
3b62fcac37
commit
61d682ebe7
1 changed files with 6 additions and 0 deletions
|
|
@ -161,6 +161,9 @@ static int lpm_offline_cpu(unsigned int cpu)
|
|||
{
|
||||
struct device *dev = get_cpu_device(cpu);
|
||||
|
||||
if (!dev)
|
||||
return 0;
|
||||
|
||||
dev_pm_qos_remove_notifier(dev, &dev_pm_qos_nb[cpu],
|
||||
DEV_PM_QOS_RESUME_LATENCY);
|
||||
return 0;
|
||||
|
|
@ -170,6 +173,9 @@ static int lpm_online_cpu(unsigned int cpu)
|
|||
{
|
||||
struct device *dev = get_cpu_device(cpu);
|
||||
|
||||
if (!dev)
|
||||
return 0;
|
||||
|
||||
dev_pm_qos_add_notifier(dev, &dev_pm_qos_nb[cpu],
|
||||
DEV_PM_QOS_RESUME_LATENCY);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue