From c7e64eea525241a383dc66c467358a9c91c5ed4a Mon Sep 17 00:00:00 2001 From: Viacheslav Galaktionov Date: Mon, 11 Oct 2021 17:48:46 +0300 Subject: [PATCH] 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: 1e7fbdf0ba19 ("net/sfc: support concept of switch domains/ports") Cc: stable@dpdk.org Signed-off-by: Viacheslav Galaktionov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/sfc/sfc_switch.c b/drivers/net/sfc/sfc_switch.c index c37cdf4a61..80c884a599 100644 --- a/drivers/net/sfc/sfc_switch.c +++ b/drivers/net/sfc/sfc_switch.c @@ -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; } -- 2.20.1