net/sfc: free MAE lock once switch domain is assigned

If for some reason the hardware switch ID initialization function fails,
MAE lock is still held after the function finishes. This patch fixes that.

Fixes: 1e7fbdf0ba ("net/sfc: support concept of switch domains/ports")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
This commit is contained in:
Viacheslav Galaktionov 2021-10-11 17:48:46 +03:00 committed by Ferruh Yigit
parent 6764c3bbdf
commit c7e64eea52

View File

@ -214,9 +214,9 @@ sfc_mae_assign_switch_domain(struct sfc_adapter *sa,
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;
}