diff mbox series

sfc: avoid duplicate error handling code in 'efx_ef10_sriov_set_vf_mac()'

Message ID 20191226150224.8701-1-christophe.jaillet@wanadoo.fr
State Accepted
Delegated to: David Miller
Headers show
Series sfc: avoid duplicate error handling code in 'efx_ef10_sriov_set_vf_mac()' | expand

Commit Message

Christophe JAILLET Dec. 26, 2019, 3:02 p.m. UTC
'eth_zero_addr()' is already called in the error handling path. This is
harmless, but there is no point in calling it twice, so remove one.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/ethernet/sfc/ef10_sriov.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

David Miller Dec. 31, 2019, 1:52 a.m. UTC | #1
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Thu, 26 Dec 2019 16:02:24 +0100

> 'eth_zero_addr()' is already called in the error handling path. This is
> harmless, but there is no point in calling it twice, so remove one.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied to net-next, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index 52bd43f45761..14393767ef9f 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -522,10 +522,9 @@  int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac)
 
 	if (!is_zero_ether_addr(mac)) {
 		rc = efx_ef10_vport_add_mac(efx, vf->vport_id, mac);
-		if (rc) {
-			eth_zero_addr(vf->mac);
+		if (rc)
 			goto fail;
-		}
+
 		if (vf->efx)
 			ether_addr_copy(vf->efx->net_dev->dev_addr, mac);
 	}