]> git.baikalelectronics.ru Git - kernel.git/commit
net: aquantia: fix unintention integer overflow on left shift
authorColin Ian King <colin.king@canonical.com>
Fri, 25 Oct 2019 11:58:11 +0000 (12:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Oct 2019 17:47:52 +0000 (10:47 -0700)
commit9d2e03f135de72ea673e32250f2bc41ac1a2f95a
treea4601cc827c98da4fa4a41c40ac6c6f8016423f9
parent5bb898e721ede5ed4223610373e1e799ed32f1ff
net: aquantia: fix unintention integer overflow on left shift

Shifting the integer value 1 is evaluated using 32-bit
arithmetic and then used in an expression that expects a 64-bit
value, so there is potentially an integer overflow. Fix this
by using the BIT_ULL macro to perform the shift and avoid the
overflow.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: 7eb2ce2467d8 ("net: aquantia: implement data PTP datapath")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_ptp.c