net/bnxt: fix to release lock in error path of stop and close op
diff mbox series

Message ID 20210113043011.6291-1-somnath.kotur@broadcom.com
State Superseded
Delegated to: Ajit Khaparde
Headers show
Series
  • net/bnxt: fix to release lock in error path of stop and close op
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch success coding style OK

Commit Message

Somnath Kotur Jan. 13, 2021, 4:30 a.m. UTC
err_recovery_lock needs to be released before returning in
stop and close_op if FW_RESET flag is set.

Fixes: 647ca0b35830 ("net/bnxt: check chip reset in dev stop and close")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 74b0f3d1dc..4d6c0a15cd 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1374,6 +1374,7 @@  static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error..Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);
@@ -1476,6 +1477,7 @@  static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error...Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);