From fe00db095de75cbf4e39bae22c8c2481526c9457 Mon Sep 17 00:00:00 2001 From: Visweswara Tanuku Date: Fri, 3 Mar 2017 11:01:52 +0530 Subject: qcacld-2.0: Avoid multiple allocations for trace buffer Global trace_buffer is being allocated multiple times in probe, whenever a sdio/usb device is inserted. But memory is being freed only once upon driver exit. This leads to memory leak. Deallocate trace buffer when device is removed CRs-Fixed: 2012750 Change-Id: I18f99fac4c8431f0701964811d29770f04553937 --- CORE/HDD/src/wlan_hdd_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 7e5007221caa..3eecb5e1e872 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -13523,6 +13523,10 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) */ hdd_stop_all_adapters( pHddCtx ); +#ifdef QCA_PKT_PROTO_TRACE + if (VOS_FTM_MODE != hdd_get_conparam()) + vos_pkt_proto_trace_close(); +#endif //Stop all the modules vosStatus = vos_stop( pVosContext ); @@ -16645,11 +16649,6 @@ static void hdd_driver_exit(void) hif_unregister_driver(); vos_preClose( &pVosContext ); -#ifdef QCA_PKT_PROTO_TRACE - if (VOS_FTM_MODE != hdd_get_conparam()) - vos_pkt_proto_trace_close(); -#endif /* QCA_PKT_PROTO_TRACE */ - #ifdef TIMER_MANAGER vos_timer_exit(); #endif -- cgit v1.2.3