net/bnxt: fix compilation with -Og
authorOlivier Matz <olivier.matz@6wind.com>
Mon, 11 Sep 2017 15:13:24 +0000 (17:13 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:50 +0000 (02:49 +0200)
commit4a671fdea9f41ecb0a6113b66d21a8eed5ac06ec
tree4c91d25ac763a6bdffb8e259c2e068862e21637a
parentfc048bd52cb7e3382da86629a5aef89f1377aca8
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: 49947a13ba9e ("net/bnxt: support Tx loopback, set VF MAC and queues drop")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
drivers/net/bnxt/rte_pmd_bnxt.c