From 3e4ac1cace13a15ee103e128c0e5dc74633dbae1 Mon Sep 17 00:00:00 2001 From: Chaithanya Garrepalli Date: Wed, 12 Dec 2018 20:50:45 +0530 Subject: [PATCH] qcacmn: Fix for the memory leak in smart monitor feature Change with fix memory leak observed in case where smart monitor is enabled and monitor direct bit is not set Change-Id: Ib556482b9067dbd7418cbe226a19bbbd5844a075 --- dp/wifi3.0/dp_rx_mon_status.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index 7333982eb5..aeb4e6ef31 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/dp/wifi3.0/dp_rx_mon_status.c @@ -413,6 +413,12 @@ dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev, qdf_spin_unlock_bh(&pdev->neighbour_peer_mutex); } + /* need not generate wdi event when mcopy and + * enhanced stats are not enabled + */ + if (!pdev->mcopy_mode && !pdev->enhanced_stats_en) + return; + if (!pdev->mcopy_mode) { if (!ppdu_info->rx_status.frame_control_info_valid) return; @@ -550,21 +556,22 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id, status_nbuf, HTT_INVALID_PEER, WDI_NO_VAL, mac_id); } + + /* smart monitor vap and m_copy cannot co-exist */ if (ppdu_info->rx_status.monitor_direct_used && pdev->neighbour_peers_added && pdev->monitor_vdev) { smart_mesh_status = dp_rx_handle_smart_mesh_mode(soc, pdev, ppdu_info, status_nbuf); if (smart_mesh_status) qdf_nbuf_free(status_nbuf); - } - if (pdev->mcopy_mode) { + } else if (pdev->mcopy_mode) { m_copy_status = dp_rx_handle_mcopy_mode(soc, pdev, ppdu_info, status_nbuf); if (m_copy_status == QDF_STATUS_SUCCESS) qdf_nbuf_free(status_nbuf); - } - if (!pdev->neighbour_peers_added && !pdev->mcopy_mode) + } else { qdf_nbuf_free(status_nbuf); + } if (tlv_status == HAL_TLV_STATUS_PPDU_NON_STD_DONE) { dp_rx_mon_deliver_non_std(soc, mac_id);