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

Commit f40618d6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: ceil idle index to prevent from out of bound accessing"

parents 334c6f02 ecedc7af
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5810,6 +5810,9 @@ static int calc_sg_energy(struct energy_env *eenv)
		idle_idx = group_idle_state(eenv, cpu_idx);
		if (unlikely(idle_idx < 0))
			return idle_idx;
		if (idle_idx > sg->sge->nr_idle_states - 1)
			idle_idx = sg->sge->nr_idle_states - 1;

		idle_power = sg->sge->idle_states[idle_idx].power;

		idle_energy   = SCHED_CAPACITY_SCALE - sg_util;