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

Commit 6e92713c authored by Puja Gupta's avatar Puja Gupta Committed by Pavankumar Kondeti
Browse files

sched: Fix possible overflow in cpu_cycles_to_freq()



Truncating period to u32 could lead to incorrect results. Make it u64
instead.

Change-Id: I5224a943e64bc6d64b6c8e614a01f798a6cdc796
Signed-off-by: default avatarPuja Gupta <pujag@codeaurora.org>
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 55cc722e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1249,7 +1249,7 @@ static inline int cpu_min_power_cost(int cpu)
	return cpu_rq(cpu)->cluster->min_power_cost;
}

static inline u32 cpu_cycles_to_freq(u64 cycles, u32 period)
static inline u32 cpu_cycles_to_freq(u64 cycles, u64 period)
{
	return div64_u64(cycles, period);
}