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

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

Merge "sched: walt: fix out-of-bounds access"

parents 239c94bb bd4ac8e5
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -2081,14 +2081,11 @@ static u32 top_task_load(struct rq *rq)
	}
}

static int load_to_index(u32 load)
static u32 load_to_index(u32 load)
{
	if (load < sched_load_granule)
		return 0;
	else if (load >= sched_ravg_window)
		return NUM_LOAD_INDICES - 1;
	else
		return load / sched_load_granule;
	u32 index = load / sched_load_granule;

	return min(index, (u32)(NUM_LOAD_INDICES - 1));
}

static void update_top_tasks(struct task_struct *p, struct rq *rq,