Parcourir la source

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
Yu Tian il y a 5 ans
Parent
commit
0cc79c7e5e
1 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 5 3
      components/ipa/core/src/wlan_ipa_core.c

+ 5 - 3
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);