diff options
| author | Nitesh Shah <niteshs@codeaurora.org> | 2017-02-01 14:35:57 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-03-03 16:35:08 -0800 |
| commit | b1ebc6836aa65e967e4309dd72d359cdb01d7846 (patch) | |
| tree | 0f549d9ec0581cd1a249685d9196cb00d9612aff | |
| parent | ad7a77d755ac29761f65a44e92666797f9350671 (diff) | |
qcacld-3.0: Acquire mutex before accessing tdls context
peer_list is a parameter for tdls_ctx, so every access to
peer_list should be protected with mutex lock.
This change refactors the code for function hdd_roam_tdls
_status_update_handler().
Change-Id: Id4fd0931df5ec38ad07657751feff34946a18c02
CRs-Fixed: 1106735
| -rw-r--r-- | core/hdd/src/wlan_hdd_assoc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 53614b07a4eb..f763cde54975 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3710,17 +3710,18 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, pHddCtx->tdlsConnInfo[staIdx].staId) { hdd_warn("HDD: del STA IDX = %x", pRoamInfo->staId); - + mutex_lock(&pHddCtx->tdls_lock); curr_peer = wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo-> peerMac.bytes, - true); + false); if (NULL != curr_peer) { hdd_info("Current status for peer " MAC_ADDRESS_STR " is %d", MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes), curr_peer->link_status); if (TDLS_IS_CONNECTED(curr_peer)) { + mutex_unlock(&pHddCtx->tdls_lock); hdd_roam_deregister_tdlssta (pAdapter, pRoamInfo->staId); @@ -3728,11 +3729,14 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, (pAdapter); } else if (eTDLS_LINK_CONNECTING == curr_peer->link_status) { + mutex_unlock(&pHddCtx->tdls_lock); hdd_roam_deregister_tdlssta (pAdapter, pRoamInfo->staId); } - } + } else + mutex_unlock(&pHddCtx->tdls_lock); + wlan_hdd_tdls_reset_peer(pAdapter, pRoamInfo-> peerMac.bytes); |
