net/bnxt: fix a bit shift operation
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 24 Oct 2017 21:19:45 +0000 (16:19 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 26 Oct 2017 00:33:01 +0000 (02:33 +0200)
We are left shifting more bits than we should be doing.
This patch fixes that.

Coverity issue: 127546
Fixes: 778b759ba10e ("net/bnxt: add MAC address")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index 786e41c..15ef0b2 100644 (file)
@@ -662,13 +662,14 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
        uint64_t pool_mask = eth_dev->data->mac_pool_sel[index];
        struct bnxt_vnic_info *vnic;
        struct bnxt_filter_info *filter, *temp_filter;
-       int i;
+       uint32_t pool = RTE_MIN(MAX_FF_POOLS, ETH_64_POOLS);
+       uint32_t i;
 
        /*
         * Loop through all VNICs from the specified filter flow pools to
         * remove the corresponding MAC addr filter
         */
-       for (i = 0; i < MAX_FF_POOLS; i++) {
+       for (i = 0; i < pool; i++) {
                if (!(pool_mask & (1ULL << i)))
                        continue;