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

Commit ddb8ca47 authored by Puja Gupta's avatar Puja Gupta
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>
parent 87b21110
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ static inline unsigned int max_task_load(void)
	return sched_ravg_window;
}

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);
}