[lvc-project] [PATCH] net: phy: mdio-bcm-unimac: Cast denominator to unsigned long to avoid overflow
Florian Fainelli
florian.fainelli at broadcom.com
Thu Mar 7 23:21:26 MSK 2024
On 3/7/2024 5:19 AM, Daniil Dulov wrote:
> The expression priv->clk_freq * 2 can lead to overflow that will cause
> a division by zero. So, let's cast it to unsigned long to avoid it.
It will not in real life because the maximum clock frequency is 250MHz,
but it also does not hurt.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: b78ac6ecd1b6 ("net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider")
> Signed-off-by: Daniil Dulov <d.dulov at aladdin.ru>
Acked-by: Florian Fainelli <florian.fainelli at broadcom.com>
--
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4221 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20240307/9239b987/attachment.bin>
More information about the lvc-project
mailing list