From: Colin Ian King Date: Mon, 17 Jun 2019 16:12:49 +0000 (+0100) Subject: net: lio_core: fix potential sign-extension overflow on large shift X-Git-Tag: v5.15~6131^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9476274093a0e79b905f4cd6cf6d149f65e02c17;p=platform%2Fkernel%2Flinux-starfive.git net: lio_core: fix potential sign-extension overflow on large shift Left shifting the signed int value 1 by 31 bits has undefined behaviour and the shift amount oq_no can be as much as 63. Fix this by using BIT_ULL(oq_no) instead. Addresses-Coverity: ("Bad shift operation") Fixes: f21fb3ed364b ("Add support of Cavium Liquidio ethernet adapters") Signed-off-by: Colin Ian King Reviewed-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c index 1c50c10..d7e8057 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c @@ -964,7 +964,7 @@ static void liquidio_schedule_droq_pkt_handlers(struct octeon_device *oct) if (droq->ops.poll_mode) { droq->ops.napi_fn(droq); - oct_priv->napi_mask |= (1 << oq_no); + oct_priv->napi_mask |= BIT_ULL(oq_no); } else { tasklet_schedule(&oct_priv->droq_tasklet); }