Re: [PATCH] OPP: of: Fix potential multiplication overflow when calculating freq
From: Viresh Kumar
Date: Mon Aug 31 2026 - 02:05:22 EST
On 26-08-26, 14:19, Colin Ian King wrote:
> The multiplication be32_to_cpup(val++) * 1000 is performed using 32 bit
> unsigned integers and hence uses a 32 bit multiplication; this will
> overflow if be32_to_cpup(val++) is greater than 4294967 (which is
> very unlikely at present). The result is assigned to an unsigned long
> (which is a 64 bit value on 64 bit systems), so fix this potential
> overflow by casting the first operand of the multiplication to
> an unsigned int.
>
> Fixes: b496dfbc94ab ("PM / OPP: Initialize OPP table from device tree")
>
> Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx>
> ---
> drivers/opp/of.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied. Thanks.
--
viresh