net/bnxt: fix compilation with -Og

The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC rte_pmd_bnxt.o
  rte_pmd_bnxt.c: In function ‘rte_pmd_bnxt_set_all_queues_drop_en’:
  rte_pmd_bnxt.c:116:6: error: ‘rc’ may be used uninitialized in this
                        function [-Werror=maybe-uninitialized]
    int rc;
        ^~

This can happen if both bp->nr_vnics and bp->pf.active_vfs are 0.
Fix it by initializing rc to -EINVAL.

Fixes: 49947a13ba ("net/bnxt: support Tx loopback, set VF MAC and queues drop")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
Olivier Matz 2017-09-11 17:13:24 +02:00 committed by Ferruh Yigit
parent fc048bd52c
commit 4a671fdea9

View File

@ -113,7 +113,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on)
struct rte_eth_dev *eth_dev;
struct bnxt *bp;
uint32_t i;
int rc;
int rc = -EINVAL;
RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);