diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-10-25 13:58:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-29 18:47:52 +0100 |
commit | 92d72f1b8bbbd87220daa49cd1253ce72bb7553c (patch) | |
tree | a4601cc827c98da4fa4a41c40ac6c6f8016423f9 | |
parent | net: aquantia: fix spelling mistake: tx_queus -> tx_queues (diff) | |
download | linux-92d72f1b8bbbd87220daa49cd1253ce72bb7553c.tar.xz linux-92d72f1b8bbbd87220daa49cd1253ce72bb7553c.zip |
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: 04a1839950d9 ("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>
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_ptp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c index 1b3be0553e31..dca092f454b4 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c @@ -713,7 +713,7 @@ static int aq_ptp_poll(struct napi_struct *napi, int budget) if (work_done < budget) { napi_complete_done(napi, work_done); aq_nic->aq_hw_ops->hw_irq_enable(aq_nic->aq_hw, - 1 << aq_ptp->ptp_ring_param.vec_idx); + BIT_ULL(aq_ptp->ptp_ring_param.vec_idx)); } err_exit: |