Re: [PATCH V2] cpufreq: scmi: Avoid overflow of target_freq in fast switch

From: Viresh Kumar
Date: Mon May 20 2024 - 04:48:00 EST


On 20-05-24, 12:07, Jagadeesh Kona wrote:
> Conversion of target_freq to HZ in scmi_cpufreq_fast_switch()
> can lead to overflow if the multiplied result is greater than
> UINT_MAX, since type of target_freq is unsigned int. Avoid this
> overflow by assigning target_freq to unsigned long variable for
> converting it to HZ.
>
> Signed-off-by: Jagadeesh Kona <quic_jkona@xxxxxxxxxxx>
> ---
> Changes in V2:
> - Updated freq variable from u64 to unsigned long to keep it
> consistent with the rate parameter in scmi .freq_set() callback
> - Link to v1: https://lore.kernel.org/all/20240517070157.19553-1-quic_jkona@xxxxxxxxxxx/
> ---
> drivers/cpufreq/scmi-cpufreq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Applied. Thanks.

--
viresh