net/i40e/base: fix possible uninitialized variable
authorGuinan Sun <guinanx.sun@intel.com>
Mon, 27 Jul 2020 05:34:48 +0000 (05:34 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:06 +0000 (18:55 +0200)
Fix possible uninitialized variable in i40e in the i40e_get_lpi_counters
function.

Fixes: 429bdc0cd967 ("net/i40e/base: add function to read LPI counters")
Cc: stable@dpdk.org
Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
drivers/net/i40e/base/i40e_common.c

index 46a0b78..85c2284 100644 (file)
@@ -7097,7 +7097,7 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw,
                                I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,
                                &cmd_status, tx_counter, rx_counter, NULL);
 
-               if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+               if (!retval && cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
                        retval = I40E_ERR_ADMIN_QUEUE_ERROR;
 
                return retval;