net/bnxt: fix bit shift size
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Sep 2016 17:39:36 +0000 (13:39 -0400)
committerBruce Richardson <bruce.richardson@intel.com>
Thu, 13 Oct 2016 13:30:59 +0000 (15:30 +0200)
Some(?) compilers will treat the unmarked constant 1 as a 32-bit
integer, but the shift operation is in a loop that could run up to
63 times -- undefined behavior!

Coverity issue: 127546
Fixes: 778b759ba10e ("net/bnxt: add MAC address")

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index 427aa69..4099a5e 100644 (file)
@@ -514,7 +514,7 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
         * remove the corresponding MAC addr filter
         */
        for (i = 0; i < MAX_FF_POOLS; i++) {
-               if (!(pool_mask & (1 << i)))
+               if (!(pool_mask & (1ULL << i)))
                        continue;
 
                STAILQ_FOREACH(vnic, &bp->ff_pool[i], next) {