Browse Source

qcacld-3.0: Protect pktlog under mutex to avoid possible race conditions

Protect pktlog funcitonality under given mutex to avoid possible
race condition between pktlog_release/pktlog_open and pktlogmod_exit.
Also call pktlogmod_exit before calling wdi_event_detach to avoid
accessing freed memory in pktlog release.

Change-Id: I452af523338788447f5c2764e883165237083f7d
CRs-Fixed: 2087777
Alok Kumar 5 years ago
parent
commit
622f2b5797
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/dp/txrx/ol_txrx.c

+ 2 - 2
core/dp/txrx/ol_txrx.c

@@ -1535,6 +1535,8 @@ static void ol_txrx_pdev_pre_detach(struct cdp_pdev *ppdev, int force)
 	OL_RX_REORDER_TRACE_DETACH(pdev);
 	OL_RX_PN_TRACE_DETACH(pdev);
 
+	htt_pktlogmod_exit(pdev);
+
 	/*
 	 * WDI event detach
 	 */
@@ -1579,8 +1581,6 @@ static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
 		return;
 	}
 
-	htt_pktlogmod_exit(pdev);
-
 	qdf_spin_lock_bh(&pdev->req_list_spinlock);
 	if (pdev->req_list_depth > 0)
 		ol_txrx_err(