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

Commit 39aa86c6 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 c49edc6a 2cadd393
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5644,6 +5644,9 @@ static int sched_group_energy(struct energy_env *eenv)
				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;

				group_util = group_norm_util(eenv, sg);
				sg_busy_energy = (group_util * sg->sge->cap_states[cap_idx].power);