Re: [PATCH net] net: phy: nxp-c45-tja11xx: fix unsigned long multiplication overflow

From: Andrew Lunn
Date: Fri Apr 07 2023 - 10:24:19 EST


On Thu, Apr 06, 2023 at 12:59:53PM +0300, Radu Pirea (OSS) wrote:
> Any multiplication between GENMASK(31, 0) and a number bigger than 1
> will be truncated because of the overflow, if the size of unsigned long
> is 32 bits.
>
> Replaced GENMASK with GENMASK_ULL to make sure that multiplication will
> be between 64 bits values.
>
> Cc: <stable@xxxxxxxxxxxxxxx> # 5.15+
> Fixes: 514def5dd339 ("phy: nxp-c45-tja11xx: add timestamping support")
> Signed-off-by: Radu Pirea (OSS) <radu-nicolae.pirea@xxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew