From 2a1312cd254db1892aa3379f19925b24aa4a2a20 Mon Sep 17 00:00:00 2001 From: nobelj Date: Thu, 20 Jun 2019 23:45:43 -0700 Subject: [PATCH] qcacmn: fix memory leak issue in tx mgmt ctrl payload tlv fix memory leak issue in tx mgmt ctrl payload tlv. if any of the mgmt or pkt capture feature is turned on. htt_t2h_msg is hold in mgmt_buf and not set to NULL on free. which cause leaking next target to host nbuf. Change-Id: I0d9e0194e51a21b348aadf747b8c9def5c245eda --- dp/inc/cdp_txrx_cmn_struct.h | 2 ++ dp/wifi3.0/dp_htt.c | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index bab6950c3f..e05856629a 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -1294,10 +1294,12 @@ struct cdp_tx_indication_mpdu_info { /** * struct cdp_tx_indication_info - Tx capture information + * @frame_payload: 802.11 payload is present already * @mpdu_info: Tx MPDU completion information * @mpdu_nbuf: reconstructed mpdu packet */ struct cdp_tx_indication_info { + uint8_t frame_payload; struct cdp_tx_indication_mpdu_info mpdu_info; qdf_nbuf_t mpdu_nbuf; }; diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index d4b02174ad..a95c038155 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -3030,17 +3030,15 @@ static bool dp_txrx_ppdu_stats_handler(struct dp_soc *soc, (pdev, htt_t2h_msg, pdev->mgmtctrl_frm_info.ppdu_id) != QDF_STATUS_SUCCESS) free_buf = false; - - if (free_buf) { - pdev->mgmtctrl_frm_info.mgmt_buf = NULL; - pdev->mgmtctrl_frm_info.mgmt_buf_len = 0; - pdev->mgmtctrl_frm_info.ppdu_id = 0; - } } if (ppdu_info) dp_ppdu_desc_deliver(pdev, ppdu_info); + pdev->mgmtctrl_frm_info.mgmt_buf = NULL; + pdev->mgmtctrl_frm_info.mgmt_buf_len = 0; + pdev->mgmtctrl_frm_info.ppdu_id = 0; + return free_buf; } #else