Procházet zdrojové kódy

qcacld-3.0: fix memory leak for mlo sta

Fix memory leak detected by mlo whunt test case

Change-Id: Ia7d8fe298bc2a4bb223650f1ea8bd84cd965cb9c
CRs-Fixed: 3012584
bings před 3 roky
rodič
revize
82adff83dc

+ 5 - 3
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -2168,6 +2168,7 @@ void lim_process_sta_add_bss_rsp_pre_assoc(struct mac_context *mac_ctx,
 			session_entry->limSmeState));
 #ifdef WLAN_FEATURE_11BE_MLO
 		if (wlan_vdev_mlme_is_mlo_link_vdev(session_entry->vdev)) {
+			qdf_mem_free(pMlmAuthReq);
 			pe_err("vdev is an MLO link, skip Auth");
 			return;
 		}
@@ -2761,8 +2762,9 @@ static void lim_process_switch_channel_join_req(
 			pe_debug("MLO:assoc rsp len + hdr %d ", assoc_rsp.len);
 
 			link_assoc_rsp.ptr = qdf_mem_malloc(assoc_rsp.len);
-			if (link_assoc_rsp.ptr) {
-				link_assoc_rsp.len = assoc_rsp.len;
+			if (!link_assoc_rsp.ptr)
+				return;
+			link_assoc_rsp.len = assoc_rsp.len;
 			session_entry->limMlmState = eLIM_MLM_WT_ASSOC_RSP_STATE;
 			pe_debug("MLO: Generate and process assoc rsp for link vdev");
 
@@ -2775,7 +2777,7 @@ static void lim_process_switch_channel_join_req(
 							    link_assoc_rsp.len,
 							    LIM_ASSOC,
 							    session_entry);
-			}
+			qdf_mem_free(link_assoc_rsp.ptr);
 		}
 		return;
 	}

+ 0 - 5
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -8933,7 +8933,6 @@ mlo_ie_convert_assoc_rsp_frame2_struct(tDot11fAssocResponse *ar,
 				       tpSirMultiLink_IE pMloIe)
 
 {
-	tDot11fIEmlo_ie *mlo_ie;
 	tDot11fIEsta_profile *sta_prof = NULL, *pStaProf = NULL;
 	uint8_t sta_index, num_sta_prof;
 
@@ -8945,10 +8944,6 @@ mlo_ie_convert_assoc_rsp_frame2_struct(tDot11fAssocResponse *ar,
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
-	mlo_ie = qdf_mem_malloc(sizeof(tDot11fIEmlo_ie));
-	if (!mlo_ie)
-		return QDF_STATUS_E_FAILURE;
-
 	/* Zero-init our [out] parameter, */
 
 	pMloIe->mlo_ie.present = ar->mlo_ie.present;