From: Somnath Kotur Date: Thu, 14 Jan 2021 02:27:16 +0000 (-0800) Subject: net/bnxt: fix lock handling in stop and close X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7db2f5edddb2e3b334e224982492e85d048ef9de;p=dpdk.git net/bnxt: fix lock handling in stop and close err_recovery_lock needs to be released before returning in stop and close_op if FW_RESET flag is set. Fixes: 6f5f3b99821e ("net/bnxt: check chip reset in stop and close") Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 3ac3818305..a3e41c91f5 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); @@ -1497,6 +1498,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);