From 0cc79c7e5e22b0cdca0efc53fee76d09dd578dd2 Mon Sep 17 00:00:00 2001 From: Yu Tian Date: Wed, 18 Sep 2019 15:11:32 +0800 Subject: [PATCH] qcacld-3.0: Fix IPA iface not initilized There is a race condition of vdev_to_iface, it is referenced in IPA W2I callback routine, but it's updated after IPA enable operation. If frames received right after IPA enabled, callback function will return failure due to vdev_to_iface value is not filled. Change-Id: Iff831b66771539d1de4af89e395821dc50d13af3 CRs-Fixed: 2517515 --- components/ipa/core/src/wlan_ipa_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/ipa/core/src/wlan_ipa_core.c b/components/ipa/core/src/wlan_ipa_core.c index d0afb963aa..8ccdf50b30 100644 --- a/components/ipa/core/src/wlan_ipa_core.c +++ b/components/ipa/core/src/wlan_ipa_core.c @@ -1865,6 +1865,9 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode, goto end; } + ipa_ctx->vdev_to_iface[session_id] = + wlan_ipa_get_ifaceid(ipa_ctx, session_id); + if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config) && (ipa_ctx->sap_num_connected_sta > 0 || wlan_ipa_is_sta_only_offload_enabled()) && @@ -1890,13 +1893,12 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode, SIR_STA_RX_DATA_OFFLOAD, session_id, false); + ipa_ctx->vdev_to_iface[session_id] = + WLAN_IPA_MAX_SESSION; goto end; } } - ipa_ctx->vdev_to_iface[session_id] = - wlan_ipa_get_ifaceid(ipa_ctx, session_id); - ipa_ctx->sta_connected = 1; qdf_mutex_release(&ipa_ctx->event_lock);