netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] intel: i40e: virtchnl: fix incorrect variable assignment
@ 2017-06-15  2:38 Gustavo A. R. Silva
  2017-06-15 20:50 ` [Intel-wired-lan] " Jesse Brandeburg
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-15  2:38 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: intel-wired-lan, netdev, linux-kernel, 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
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 6bee254..fb1f018 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Intel-wired-lan] [PATCH] intel: i40e: virtchnl: fix incorrect variable assignment
  2017-06-15  2:38 [PATCH] intel: i40e: virtchnl: fix incorrect variable assignment Gustavo A. R. Silva
@ 2017-06-15 20:50 ` Jesse Brandeburg
  2017-06-15 21:07   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Jesse Brandeburg @ 2017-06-15 20:50 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Jeff Kirsher, netdev, intel-wired-lan, linux-kernel, jesse.brandeburg

On Wed, 14 Jun 2017 21:38:26 -0500
"Gustavo A. R. Silva" <garsilva@embeddedor.com> wrote:

> 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
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Thanks for the fix, looks reasonable.
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Intel-wired-lan] [PATCH] intel: i40e: virtchnl: fix incorrect variable assignment
  2017-06-15 20:50 ` [Intel-wired-lan] " Jesse Brandeburg
@ 2017-06-15 21:07   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-15 21:07 UTC (permalink / raw)
  To: Jesse Brandeburg; +Cc: Jeff Kirsher, netdev, intel-wired-lan, linux-kernel

Hi Jesse,

Quoting Jesse Brandeburg <jesse.brandeburg@intel.com>:

> On Wed, 14 Jun 2017 21:38:26 -0500
> "Gustavo A. R. Silva" <garsilva@embeddedor.com> wrote:
>
>> 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
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>
> Thanks for the fix, looks reasonable.
> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

Absolutely, glad to help.

Regards

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-15 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15  2:38 [PATCH] intel: i40e: virtchnl: fix incorrect variable assignment Gustavo A. R. Silva
2017-06-15 20:50 ` [Intel-wired-lan] " Jesse Brandeburg
2017-06-15 21:07   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).