]> git.baikalelectronics.ru Git - kernel.git/commit
net: lio_core: fix potential sign-extension overflow on large shift
authorColin Ian King <colin.king@canonical.com>
Mon, 17 Jun 2019 16:12:49 +0000 (17:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2019 01:00:40 +0000 (21:00 -0400)
commit0aa5b97880d3d23c9a0ffd2bb02e9bc264b880a7
tree85219d8c26c8286bf2fcaa0f504b795fb1b82817
parent852e7e6c1cfb41d02f0253fe8d42b61b0aad59f1
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: 3dd251efd9d6 ("Add support of Cavium Liquidio ethernet adapters")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/lio_core.c