diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index af02610ede1f..16d715302572 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -2855,13 +2855,7 @@ void wma_vdev_resp_timer(void *data) void *peer; void *soc = cds_get_context(QDF_MODULE_ID_SOC); #ifdef FEATURE_AP_MCC_CH_AVOIDANCE - tpAniSirGlobal mac_ctx = cds_get_context(QDF_MODULE_ID_PE); - - if (NULL == mac_ctx) { - WMA_LOGE("%s: Failed to get mac_ctx", __func__); - wma_cleanup_target_req_param(tgt_req); - goto free_tgt_req; - } + tpAniSirGlobal mac_ctx; #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ wma = cds_get_context(QDF_MODULE_ID_WMA); @@ -2892,6 +2886,15 @@ void wma_vdev_resp_timer(void *data) goto free_tgt_req; } +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + mac_ctx = cds_get_context(QDF_MODULE_ID_PE); + if (!mac_ctx) { + WMA_LOGE("%s: Failed to get mac_ctx", __func__); + wma_cleanup_target_req_param(tgt_req); + goto free_tgt_req; + } +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ + if (tgt_req->msg_type == WMA_CHNL_SWITCH_REQ) { tpSwitchChannelParams params = (tpSwitchChannelParams) tgt_req->user_data; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 5ebc225d409c..cea38802d3fe 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1796,7 +1796,8 @@ static void wma_cleanup_vdev_resp_queue(tp_wma_handle wma) return; } - while (qdf_list_remove_front(&wma->vdev_resp_queue, &node1) == + /* peek front, and then cleanup it in wma_vdev_resp_timer */ + while (qdf_list_peek_front(&wma->vdev_resp_queue, &node1) == QDF_STATUS_SUCCESS) { req_msg = qdf_container_of(node1, struct wma_target_req, node); qdf_spin_unlock_bh(&wma->vdev_respq_lock); @@ -1825,8 +1826,9 @@ static void wma_cleanup_hold_req(tp_wma_handle wma) return; } + /* peek front, and then cleanup it in wma_hold_req_timer */ while (QDF_STATUS_SUCCESS == - qdf_list_remove_front(&wma->wma_hold_req_queue, &node1)) { + qdf_list_peek_front(&wma->wma_hold_req_queue, &node1)) { req_msg = qdf_container_of(node1, struct wma_target_req, node); qdf_spin_unlock_bh(&wma->wma_hold_req_q_lock); /* Cleanup timeout handler */