From 3d112d16044ac49bbb0a01da525b8408a29a656f Mon Sep 17 00:00:00 2001 From: Guinan Sun Date: Mon, 27 Jul 2020 05:34:48 +0000 Subject: [PATCH] net/i40e/base: fix possible uninitialized variable 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 Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 46a0b78816..85c22849e1 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -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; -- 2.20.1