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

Commit 9e84f2e1 authored by Venkat Devarasetty's avatar Venkat Devarasetty
Browse files

lpm-levels: Add a NULL check of next event time



The next event value could be NULL if there is no event
queued. Add a NULL check to avoid wrong calculation of
next wakeup time.

Change-Id: I1ddd8db1803c8f88e99c050e8e40fb6cb5326bda
Signed-off-by: default avatarVenkat Devarasetty <vdevaras@codeaurora.org>
parent f8fa637b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -308,7 +308,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
		if (best_level_pwr >= pwr) {
			best_level = i;
			best_level_pwr = pwr;
			if (next_event_us < sleep_us &&
			if (next_event_us && next_event_us < sleep_us &&
				(mode != MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT))
				modified_time_us
					= next_event_us - lvl_latency_us;