net/sfc: free MAE lock once switch domain is assigned
[dpdk.git] / drivers / net / sfc / sfc_switch.c
index bdea2a2..80c884a 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2019-2021 Xilinx, Inc.
  * Copyright(c) 2019 Solarflare Communications Inc.
  *
  * This software was jointly developed between OKTET Labs (under contract
@@ -214,9 +214,9 @@ fail_domain_alloc:
 
 fail_mem_alloc:
        sfc_hw_switch_id_fini(sa, hw_switch_id);
-       rte_spinlock_unlock(&sfc_mae_switch.lock);
 
 fail_hw_switch_id_init:
+       rte_spinlock_unlock(&sfc_mae_switch.lock);
        return rc;
 }