소스 검색

qcacld-3.0: Fix race condition between WMI control RX and driver unload

This is a qcacld-2.0 to qcacld-3.0 propagation

Don’t unregister the event in LIM cleanup since it will be take care
by WMI service close. Also in tlshim_mgmt_rx_wmi_handler, add driver
load/unload check to avoid processing any WMI_MGMT_RX_EVENTID event
even the handler is not NULL

Change-Id: I72b53b614218f26e874c964a0d8b0affba6cda79
CRs-Fixed: 904490
Naveen Rawat 9 년 전
부모
커밋
0b72dc6d45
2개의 변경된 파일9개의 추가작업 그리고 14개의 파일을 삭제
  1. 4 14
      core/mac/src/pe/lim/lim_api.c
  2. 5 0
      core/wma/src/wma_mgmt.c

+ 4 - 14
core/mac/src/pe/lim/lim_api.c

@@ -644,11 +644,10 @@ tSirRetStatus lim_initialize(tpAniSirGlobal pMac)
 
 void lim_cleanup(tpAniSirGlobal pMac)
 {
-	void *p_cds_gctx;
-	CDF_STATUS retStatus;
-
-	/*Before destroying the list making sure all the nodes have been deleted
-	 *Which should be the normal case, but a memory leak has been reported
+	/*
+	 * Before destroying the list making sure all the nodes have been
+	 * deleted Which should be the normal case, but a memory leak has been
+	 * reported
 	 */
 
 	struct mgmt_frm_reg_info *pLimMgmtRegistration = NULL;
@@ -708,15 +707,6 @@ void lim_cleanup(tpAniSirGlobal pMac)
 	/* Now, finally reset the deferred message queue pointers */
 	lim_reset_deferred_msg_q(pMac);
 
-	p_cds_gctx = cds_get_global_context();
-	retStatus = wma_de_register_mgmt_frm_client(p_cds_gctx);
-
-	if (retStatus != CDF_STATUS_SUCCESS)
-		PELOGE(lim_log
-			(pMac, LOGE,
-			FL
-			("DeRegistering the PE Handle with wma has failed bailing out..."));
-		)
 #if defined WLAN_FEATURE_VOWIFI
 	rrm_cleanup(pMac);
 #endif

+ 5 - 0
core/wma/src/wma_mgmt.c

@@ -3049,6 +3049,11 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
 		return -ENOMEM;
 	}
 
+	if (cds_is_load_unload_in_progress()) {
+		WMA_LOGE("Load/Unload in progress");
+		return -EINVAL;
+	}
+
 	cdf_mem_zero(rx_pkt, sizeof(*rx_pkt));
 
 	/*