]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: topology: fix possible overflow in amu_fie_setup()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Fri, 16 Sep 2022 20:17:07 +0000 (23:17 +0300)
committerWill Deacon <will@kernel.org>
Thu, 22 Sep 2022 11:57:06 +0000 (12:57 +0100)
commit389c80b5ece2adee99b6e0597fe072ef2c4e6e69
tree9311ec80e3e76ab5f92e1ce2f8c1f5da9398f1bc
parentf58d15a46cd6bf31c6767a2e100f92540aaba0bd
arm64: topology: fix possible overflow in amu_fie_setup()

cpufreq_get_hw_max_freq() returns max frequency in kHz as *unsigned int*,
while freq_inv_set_max_ratio() gets passed this frequency in Hz as 'u64'.
Multiplying max frequency by 1000 can potentially result in overflow --
multiplying by 1000ULL instead should avoid that...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Fixes: 383665b8ed0e ("arm64: use activity monitors for frequency invariance")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/01493d64-2bce-d968-86dc-11a122a9c07d@omp.ru
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/topology.c