From: Farah Smith <[email protected]>

In ulp_tfc_deinit(), ulp_tfc_tbl_scope_deinit() was called after
pthread_mutex_destroy() had already destroyed the flow db lock
(flow_db_lock) instead of before it. Reorder so table scope
cleanup completes before the lock is destroyed.

Fixes: dd0191d5e70d ("net/bnxt/tf_ulp: support Thor2 ULP layer")
Cc: [email protected]

Signed-off-by: Farah Smith <[email protected]>
Signed-off-by: Manish Kurup <[email protected]>
---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c 
b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
index d5ce4c3c18..cc85f3b486 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
@@ -957,11 +957,11 @@ ulp_tfc_deinit(struct bnxt *bp,
        /* Delete the Port database */
        ulp_port_db_deinit(bp->ulp_ctx);
 
+       ulp_tfc_tbl_scope_deinit(bp);
+
        /* free the flow db lock */
        pthread_mutex_destroy(&bp->ulp_ctx->cfg_data->flow_db_lock);
 
-       ulp_tfc_tbl_scope_deinit(bp);
-
        rc = tfc_session_fid_rem(&bp->tfcp, bp->fw_fid, &fid_cnt);
        if (rc)
                BNXT_DRV_DBG(ERR, "Failed to remove RFID:%d from SID:%d\n",
-- 
2.31.1

Reply via email to