Skip to content

Commit

Permalink
net/i40e: fix MAC removal check
Browse files Browse the repository at this point in the history
[ upstream commit 73bd0ad ]

Add return value check for i40e_vsi_delete_mac call in
rte_pmd_i40e_remove_vf_mac_addr as per coverity issue.

Coverity issue: 277224
Fixes: e0cb962 ("net/i40e: add support for representor ports")

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
  • Loading branch information
hero24 authored and kevintraynor committed Aug 28, 2019
1 parent ef3a5d0 commit 37f15b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/i40e/rte_pmd_i40e.c
Expand Up @@ -580,6 +580,7 @@ rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
struct i40e_pf_vf *vf;
struct i40e_vsi *vsi;
struct i40e_pf *pf;
int ret;

if (i40e_validate_mac_addr((u8 *)mac_addr) != I40E_SUCCESS)
return -EINVAL;
Expand Down Expand Up @@ -608,8 +609,9 @@ rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,
ether_addr_copy(&null_mac_addr, &vf->mac_addr);

/* Remove the mac */
i40e_vsi_delete_mac(vsi, mac_addr);

ret = i40e_vsi_delete_mac(vsi, mac_addr);
if (ret != I40E_SUCCESS)
return ret;
return 0;
}

Expand Down

0 comments on commit 37f15b0

Please sign in to comment.