diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index 7df7521700d7..16da226c94be 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -1869,7 +1869,7 @@ int hdd_init_nan_data_mode(struct hdd_adapter_s *adapter) status = sme_open_session(hdd_ctx->hHal, hdd_sme_roam_callback, adapter, (uint8_t *)&adapter->macAddressCurrent, &adapter->sessionId, type, sub_type); - if (QDF_STATUS_SUCCESS == status) { + if (QDF_STATUS_SUCCESS != status) { hdd_err("sme_open_session() failed with status code %d", status); ret_val = -EAGAIN; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 6ec3e19a9dbe..6cd8de9fc23c 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -2131,7 +2131,8 @@ lim_add_sta(tpAniSirGlobal mac_ctx, } qdf_mem_set((uint8_t *) add_sta_params, sizeof(tAddStaParams), 0); - if (LIM_IS_AP_ROLE(session_entry) || LIM_IS_IBSS_ROLE(session_entry)) + if (LIM_IS_AP_ROLE(session_entry) || LIM_IS_IBSS_ROLE(session_entry) || + LIM_IS_NDI_ROLE(session_entry)) sta_Addr = &sta_ds->staAddr; #ifdef FEATURE_WLAN_TDLS /* SystemRole shouldn't be matter if staType is TDLS peer */ diff --git a/core/mac/src/pe/nan/nan_datapath.c b/core/mac/src/pe/nan/nan_datapath.c index 1bfe381aafef..6a1fd99f8a1c 100644 --- a/core/mac/src/pe/nan/nan_datapath.c +++ b/core/mac/src/pe/nan/nan_datapath.c @@ -128,7 +128,7 @@ static QDF_STATUS lim_add_ndi_peer(tpAniSirGlobal mac_ctx, static QDF_STATUS lim_handle_ndp_indication_event(tpAniSirGlobal mac_ctx, struct ndp_indication_event *ndp_ind) { - QDF_STATUS status; + QDF_STATUS status = QDF_STATUS_SUCCESS; lim_log(mac_ctx, LOG1, FL("role: %d, vdev: %d, peer_mac_addr "MAC_ADDRESS_STR), @@ -138,10 +138,6 @@ static QDF_STATUS lim_handle_ndp_indication_event(tpAniSirGlobal mac_ctx, if ((ndp_ind->role == NDP_ROLE_INITIATOR) || ((NDP_ROLE_RESPONDER == ndp_ind->role) && (NDP_ACCEPT_POLICY_ALL == ndp_ind->policy))) { - /* Free config only for INITIATOR role */ - qdf_mem_free(ndp_ind->ndp_config.ndp_cfg); - qdf_mem_free(ndp_ind->ndp_info.ndp_app_info); - status = lim_add_ndi_peer(mac_ctx, ndp_ind->vdev_id, ndp_ind->peer_mac_addr); if (QDF_STATUS_SUCCESS != status) { @@ -168,10 +164,12 @@ ndp_indication_failed: * As for success responder case this info is sent till HDD * and will be freed in sme. */ - if ((status != QDF_STATUS_SUCCESS) || - (NDP_ROLE_INITIATOR == ndp_ind->role)) { + if (status != QDF_STATUS_SUCCESS || + NDP_ROLE_INITIATOR == ndp_ind->role) { qdf_mem_free(ndp_ind->ndp_config.ndp_cfg); qdf_mem_free(ndp_ind->ndp_info.ndp_app_info); + ndp_ind->ndp_config.ndp_cfg = NULL; + ndp_ind->ndp_info.ndp_app_info = NULL; } return status; } @@ -496,8 +494,6 @@ QDF_STATUS lim_handle_ndp_event_message(tpAniSirGlobal mac_ctx, cds_msg_t *msg) case SIR_HAL_NDP_INDICATION: { struct ndp_indication_event *ndp_ind = msg->bodyptr; status = lim_handle_ndp_indication_event(mac_ctx, ndp_ind); - qdf_mem_free(ndp_ind->ndp_config.ndp_cfg); - qdf_mem_free(ndp_ind->ndp_info.ndp_app_info); break; } case SIR_HAL_NDP_RESPONDER_RSP: diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 48429162003f..763946a76cf0 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -6342,18 +6342,19 @@ static void csr_roam_process_start_bss_success(tpAniSirGlobal mac_ctx, roam_info.u.pConnectedProfile = &session->connectedProfile; qdf_mem_copy(&roam_info.bssid, &bss_desc->bssId, sizeof(struct qdf_mac_addr)); - } - csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED, - session_id); - if (!QDF_IS_STATUS_SUCCESS - (csr_get_parsed_bss_description_ies(mac_ctx, bss_desc, - &ies_ptr))) { - sms_log(mac_ctx, LOGW, FL("cannot parse IBSS IEs")); - roam_info.pBssDesc = bss_desc; - csr_roam_call_callback(mac_ctx, session_id, &roam_info, - cmd->u.roamCmd.roamId, eCSR_ROAM_IBSS_IND, - eCSR_ROAM_RESULT_IBSS_START_FAILED); - return; + } else { + csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED, + session_id); + if (!QDF_IS_STATUS_SUCCESS + (csr_get_parsed_bss_description_ies(mac_ctx, bss_desc, + &ies_ptr))) { + sms_log(mac_ctx, LOGW, FL("cannot parse IBSS IEs")); + roam_info.pBssDesc = bss_desc; + csr_roam_call_callback(mac_ctx, session_id, &roam_info, + cmd->u.roamCmd.roamId, eCSR_ROAM_IBSS_IND, + eCSR_ROAM_RESULT_IBSS_START_FAILED); + return; + } } if (!CSR_IS_INFRA_AP(profile)) { scan_res = diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 6146ac63c76c..ee018bde2d36 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -3965,8 +3965,8 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle) wma_handle->fine_time_measurement_cap; wma_setup_egap_support(&tgt_cfg, wma_handle); - wma_handle->tgt_cfg_update_cb(hdd_ctx, &tgt_cfg); wma_update_hdd_cfg_ndp(wma_handle, &tgt_cfg); + wma_handle->tgt_cfg_update_cb(hdd_ctx, &tgt_cfg); } /** diff --git a/core/wma/src/wma_nan_datapath.c b/core/wma/src/wma_nan_datapath.c index eb0a78dd5654..b55ff5060262 100644 --- a/core/wma/src/wma_nan_datapath.c +++ b/core/wma/src/wma_nan_datapath.c @@ -967,7 +967,7 @@ void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss) } pdev = cds_get_context(QDF_MODULE_ID_TXRX); - if (pdev) { + if (!pdev) { WMA_LOGE("%s: Failed to get pdev", __func__); goto send_fail_resp; }