[dpdk-dev] net/i40e: fix return code not checked

Message ID 20170810091214.72408-1-danielx.t.mrzyglod@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Daniel Mrzyglod Aug. 10, 2017, 9:12 a.m. UTC
  Calling i40e_vsi_delete_mac without checking return
value (as is done elsewhere 5 out of 6 times)

Coverity issue: 140735
Fixes: 43c89d5a4fde ("net/i40e: set VF MAC from PF")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit Aug. 18, 2017, 2:23 p.m. UTC | #1
On 8/10/2017 10:12 AM, Daniel Mrzyglod wrote:
> Calling i40e_vsi_delete_mac without checking return
> value (as is done elsewhere 5 out of 6 times)
> 
> Coverity issue: 140735
> Fixes: 43c89d5a4fde ("net/i40e: set VF MAC from PF")
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit Aug. 18, 2017, 2:26 p.m. UTC | #2
On 8/18/2017 3:23 PM, Ferruh Yigit wrote:
> On 8/10/2017 10:12 AM, Daniel Mrzyglod wrote:
>> Calling i40e_vsi_delete_mac without checking return
>> value (as is done elsewhere 5 out of 6 times)
>>
>> Coverity issue: 140735
>> Fixes: 43c89d5a4fde ("net/i40e: set VF MAC from PF")
>>
>> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index f12b7f4a1..950a0d6a2 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -591,7 +591,9 @@  rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id,
 
 	/* Remove all existing mac */
 	TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp)
-		i40e_vsi_delete_mac(vsi, &f->mac_info.mac_addr);
+		if (i40e_vsi_delete_mac(vsi, &f->mac_info.mac_addr)
+				!= I40E_SUCCESS)
+			PMD_DRV_LOG(WARNING, "Delete MAC failed");
 
 	return 0;
 }