diff options
| author | Rajeev Kumar <rajekuma@qca.qualcomm.com> | 2014-08-05 15:42:48 -0700 |
|---|---|---|
| committer | Pitani Venkata Rajesh Kumar <c_vpitan@qti.qualcomm.com> | 2014-08-08 10:37:39 +0530 |
| commit | 850cc8ed4c01eb51596e3356b7bf1806aaaff51b (patch) | |
| tree | 96d06296dd7cc9ad3be99547e0e008bc681b6101 | |
| parent | 8f50a182671c364fbb691d051ba705ef47a42a6b (diff) | |
qcacld: Fix of memory leak in wlan_hdd_tdls_exit
Memory allocated for tInfo in wlan_hdd_tdls_exit is never
freed because by the time TDLS exit is called during driver
unload sequence from HDD close adapters MC thread is already
shutdown. This message posting during driver unload is kind
of dead code which is never processed.
Change-Id: Ia19c6146bc8deb5bb4705e9906296a86336d4430
CRs-Fixed: 703066
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tdls.c | 86 |
1 files changed, 46 insertions, 40 deletions
diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index 1803644468cc..4c9f73e81221 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -678,38 +678,43 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) wlan_hdd_tdls_free_scan_request(&pHddCtx->tdls_scan_ctxt); - tInfo = vos_mem_malloc(sizeof(tdlsInfo_t)); - if (NULL != tInfo) - { - tInfo->vdev_id = pAdapter->sessionId; - tInfo->tdls_state = eTDLS_SUPPORT_DISABLED; - tInfo->notification_interval_ms = - pHddTdlsCtx->threshold_config.tx_period_t; - tInfo->tx_discovery_threshold = - pHddTdlsCtx->threshold_config.tx_packet_n; - tInfo->tx_teardown_threshold = pHddTdlsCtx->threshold_config.idle_packet_n; - tInfo->rssi_teardown_threshold = - pHddTdlsCtx->threshold_config.rssi_teardown_threshold; - tInfo->rssi_delta = pHddTdlsCtx->threshold_config.rssi_delta; - tInfo->tdls_options = 0; - if (pHddCtx->cfg_ini->fEnableTDLSOffChannel) - tInfo->tdls_options |= ENA_TDLS_OFFCHAN; - if (pHddCtx->cfg_ini->fEnableTDLSBufferSta) - tInfo->tdls_options |= ENA_TDLS_BUFFER_STA; - if (pHddCtx->cfg_ini->fEnableTDLSSleepSta) - tInfo->tdls_options |= ENA_TDLS_SLEEP_STA; - tInfo->peer_traffic_ind_window = - pHddCtx->cfg_ini->fTDLSPuapsdPTIWindow; - tInfo->peer_traffic_response_timeout = - pHddCtx->cfg_ini->fTDLSPuapsdPTRTimeout; - tInfo->puapsd_mask = - pHddCtx->cfg_ini->fTDLSUapsdMask; - tInfo->puapsd_inactivity_time = - pHddCtx->cfg_ini->fTDLSPuapsdInactivityTimer; - tInfo->puapsd_rx_frame_threshold = - pHddCtx->cfg_ini->fTDLSRxFrameThreshold; + /* No need to post message during driver unlaod because MC thread is + already shutdown */ + if ( !pHddCtx->isUnloadInProgress) + { + tInfo = vos_mem_malloc(sizeof(tdlsInfo_t)); + if (NULL != tInfo) + { + tInfo->vdev_id = pAdapter->sessionId; + tInfo->tdls_state = eTDLS_SUPPORT_DISABLED; + tInfo->notification_interval_ms = + pHddTdlsCtx->threshold_config.tx_period_t; + tInfo->tx_discovery_threshold = + pHddTdlsCtx->threshold_config.tx_packet_n; + tInfo->tx_teardown_threshold = + pHddTdlsCtx->threshold_config.idle_packet_n; + tInfo->rssi_teardown_threshold = + pHddTdlsCtx->threshold_config.rssi_teardown_threshold; + tInfo->rssi_delta = pHddTdlsCtx->threshold_config.rssi_delta; + tInfo->tdls_options = 0; + if (pHddCtx->cfg_ini->fEnableTDLSOffChannel) + tInfo->tdls_options |= ENA_TDLS_OFFCHAN; + if (pHddCtx->cfg_ini->fEnableTDLSBufferSta) + tInfo->tdls_options |= ENA_TDLS_BUFFER_STA; + if (pHddCtx->cfg_ini->fEnableTDLSSleepSta) + tInfo->tdls_options |= ENA_TDLS_SLEEP_STA; + tInfo->peer_traffic_ind_window = + pHddCtx->cfg_ini->fTDLSPuapsdPTIWindow; + tInfo->peer_traffic_response_timeout = + pHddCtx->cfg_ini->fTDLSPuapsdPTRTimeout; + tInfo->puapsd_mask = + pHddCtx->cfg_ini->fTDLSUapsdMask; + tInfo->puapsd_inactivity_time = + pHddCtx->cfg_ini->fTDLSPuapsdInactivityTimer; + tInfo->puapsd_rx_frame_threshold = + pHddCtx->cfg_ini->fTDLSRxFrameThreshold; - VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, + VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "%s: Setting tdls state and param in fw: " "vdev_id: %d, " "tdls_state: %d, " @@ -739,17 +744,18 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) tInfo->puapsd_inactivity_time, tInfo->puapsd_rx_frame_threshold); - halStatus = sme_UpdateFwTdlsState(pHddCtx->hHal, tInfo, FALSE); - if (eHAL_STATUS_SUCCESS != halStatus) - { - vos_mem_free(tInfo); - } - } - else - { + halStatus = sme_UpdateFwTdlsState(pHddCtx->hHal, tInfo, FALSE); + if (eHAL_STATUS_SUCCESS != halStatus) + { + vos_mem_free(tInfo); + } + } + else + { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: vos_mem_alloc failed for tInfo", __func__); - } + } + } vos_mem_free(pHddTdlsCtx); pAdapter->sessionCtx.station.pHddTdlsCtx = NULL; |
