From 06f59685fceda209df277cbbb344aa44f6e22ba5 Mon Sep 17 00:00:00 2001 From: DARAM SUDHA Date: Wed, 18 Mar 2015 15:50:59 +0530 Subject: qcacld: acquire lock of remain_on_chan_ctx_lock before unlocking In wlan_hdd_cleanup_remain_on_channel_ctx, while cleaning up the RoC context at hdd_stop_adapter() in driver unload path, lock needs to be aquired before break. Change-Id: I386fcc2eb433ec0067d5973b7401fbb34d167647 CRs-Fixed: 809190 --- CORE/HDD/src/wlan_hdd_p2p.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c index dce1b00c4bd5..ded3f8c2fc5b 100644 --- a/CORE/HDD/src/wlan_hdd_p2p.c +++ b/CORE/HDD/src/wlan_hdd_p2p.c @@ -473,12 +473,13 @@ void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter) pAdapter->is_roc_inprogress = FALSE; } mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - } + /* hold the lock before break from the loop */ + mutex_lock(&cfgState->remain_on_chan_ctx_lock); break; } mutex_lock(&cfgState->remain_on_chan_ctx_lock); - } + } /* end of while */ mutex_unlock(&cfgState->remain_on_chan_ctx_lock); } -- cgit v1.2.3