瀏覽代碼

qcacld-3.0: Avoid memory leak if don't found session

It won't free the nbuffer when tx mgmt frame and don't found session,
then cause memory leak. So free memory to avoid memory leak.

Change-Id: I4e6c2fcdcbf9fa549887602eeaeee3126edc1ef5
CRs-Fixed: 2400974
Wu Gao 6 年之前
父節點
當前提交
7c0a23f682
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      core/mac/src/pe/lim/lim_send_management_frames.c

+ 3 - 1
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -4761,7 +4761,9 @@ static void lim_tx_mgmt_frame(struct mac_context *mac_ctx,
 	sme_session_id = mb_msg->session_id;
 	session = pe_find_session_by_sme_session_id(mac_ctx, sme_session_id);
 	if (session == NULL) {
-		pe_err("session not found for given sme session");
+		cds_packet_free((void *)packet);
+		pe_err("session not found for given sme session %d",
+		       sme_session_id);
 		return;
 	}