summaryrefslogtreecommitdiff
path: root/kernel/sched/sched.h
diff options
context:
space:
mode:
authorPuja Gupta <pujag@codeaurora.org>2017-11-16 13:39:33 -0800
committerPavankumar Kondeti <pkondeti@codeaurora.org>2018-01-05 09:15:54 +0530
commit6e92713cbafca57d48efdf2108fedb68addbb00b (patch)
tree75e81af35171125f0e8cbf13f8ee1b55a82defa8 /kernel/sched/sched.h
parent55cc722ec6725f7547071a396606f6a04b9a75e8 (diff)
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: Puja Gupta <pujag@codeaurora.org> Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r--kernel/sched/sched.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 7426ae4dced3..c0e3314bf4c2 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -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);
}