]> git.itanic.dy.fi Git - linux-stable/commit
net: phy: nxp-c45-tja11xx: fix unsigned long multiplication overflow
authorRadu Pirea (OSS) <radu-nicolae.pirea@oss.nxp.com>
Thu, 6 Apr 2023 09:59:53 +0000 (12:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 10:35:13 +0000 (12:35 +0200)
commitc918d0bc687c0e020dfc8f3673b08ac57174f73a
tree53741a8006f745fd0e673353d855e5774de506e9
parent4fb1a978a37345dfe8cbb3c6cbc4d4a6663a8294
net: phy: nxp-c45-tja11xx: fix unsigned long multiplication overflow

commit bdaaecc127d471c422ee9e994978617c8aa79e1e upstream.

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@vger.kernel.org> # 5.15+
Fixes: 514def5dd339 ("phy: nxp-c45-tja11xx: add timestamping support")
Signed-off-by: Radu Pirea (OSS) <radu-nicolae.pirea@oss.nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230406095953.75622-1-radu-nicolae.pirea@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/nxp-c45-tja11xx.c