Skip to contentSkip to conversation

intel: i40e: virtchnl: fix incorrect variable assignment

PATCH In review Gustavo A. R. Silva 3 participants 4 messages Jun 15, 2017 – Jun 20, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel: i40e: virtchnl: fix incorrect variable assignment

Fix incorrect variable assignment.
Based on line 1511: aq_ret = I40_ERR_PARAM; the correct variable to be used in this instance is aq_ret instead of ret. Also, variable ret is updated at line 1602 just before return, so assigning a value to this variable in this code block is useless.

Addresses-Coverity-ID: 1397693

---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -1
index 6bee254..fb1f018 100644
@@ -1567,7 +1567,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
 			dev_err(&pf->pdev->dev,
 				"VF %d requested polling mode: this feature is supported only when the device is running in single function per port (SFP) mode\n",
 				 vf->vf_id);
-			ret = I40E_ERR_PARAM;
+			aq_ret = I40E_ERR_PARAM;
 			goto err;
 		}
 		vfres->vf_offload_flags |= VIRTCHNL_VF_OFFLOAD_RX_POLLING;
Signature · 1 line
2.5.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Wed, 14 Jun 2017 21:38:26 -0500 "Gustavo A. R. Silva"…

Fix incorrect variable assignment.
Based on line 1511: aq_ret = I40_ERR_PARAM; the correct variable to be used in this instance is aq_ret instead of ret. Also, variable ret is updated at line 1602 just before return, so assigning a value to this variable in this code block is useless.

Addresses-Coverity-ID: 1397693

Thanks for the fix, looks reasonable.

#2 lore raw

Hi Jesse,

Quoting Jesse Brandeburg <[email protected]>:

Quoted 9 lines
Quoted 6 lines · On Wed, 14 Jun 2017 21:38:26 -0500 "Gustavo A. R. Silva"…

Fix incorrect variable assignment.
Based on line 1511: aq_ret = I40_ERR_PARAM; the correct variable to be used in this instance is aq_ret instead of ret. Also, variable ret is updated at line 1602 just before return, so assigning a value to this variable in this code block is useless.

Quoted 5 lines
Quoted 2 lines

Addresses-Coverity-ID: 1397693

Thanks for the fix, looks reasonable.

Absolutely, glad to help.

Regards
--
Gustavo A. R. Silva

#3 lore raw

PATCH 1/1 intel: i40e: virtchnl: fix incorrect variable assignment

In reply to Gustavo A. R. Silva
Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Gustavo A. R. Silva
Sent: Wednesday, June 14, 2017 7:38 PM
To: Kirsher, Jeffrey T <[email protected]>
Cc: netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org; linux- kernel at vger.kernel.org; Gustavo A. R. Silva <[email protected]>
Subject: [Intel-wired-lan] [PATCH] intel: i40e: virtchnl: fix incorrect variable assignment

Fix incorrect variable assignment.
Based on line 1511: aq_ret = I40_ERR_PARAM; the correct variable to be used in this instance is aq_ret instead of ret. Also, variable ret is updated at line 1602 just before return, so assigning a value to this variable in this code block is useless.

Quoted 5 lines

Addresses-Coverity-ID: 1397693

---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)