sfc: avoid duplicated code in ef10_sriov
authorÍñigo Huguet <ihuguet@redhat.com>
Mon, 21 Jun 2021 15:32:38 +0000 (17:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Jun 2021 16:51:13 +0000 (09:51 -0700)
The fail path of efx_ef10_sriov_alloc_vf_vswitching is identical to the
full content of efx_ef10_sriov_free_vf_vswitching, so replace it for a
single call to efx_ef10_sriov_free_vf_vswitching.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef10_sriov.c

index f8f8fbe..752d640 100644 (file)
@@ -206,9 +206,7 @@ static int efx_ef10_sriov_alloc_vf_vswitching(struct efx_nic *efx)
 
        return 0;
 fail:
-       efx_ef10_sriov_free_vf_vports(efx);
-       kfree(nic_data->vf);
-       nic_data->vf = NULL;
+       efx_ef10_sriov_free_vf_vswitching(efx);
        return rc;
 }