Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61d682eb authored by Maulik Shah's avatar Maulik Shah
Browse files

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: default avatarMaulik Shah <mkshah@codeaurora.org>
parent 3b62fcac
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;