Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27cb5157 authored by Srinivas Dasari's avatar Srinivas Dasari Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: Use hdd_for_each_sta_ref_safe API for connection status

When a NAN request(NAN enable/disable/any generic) is received
from userspace, host driver checks if any connection(STA/SAP/P2P)
is in progress by iterating through adapters. The request would be
rejected if any adapter has connection_in_progress status.

But if the adapter is getting cleaned up in parallel while
iterating through the list for connection status, the iterator
callback may stuck in loop. So, use hdd_for_each_sta_ref_safe()
API to avoid stuck in loop.

Change-Id: Ic7833dcb17154003565ccbece31a490ee9f43beb
CRs-Fixed: 3183232
parent 1cad4bb5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -18393,7 +18393,7 @@ static QDF_STATUS hdd_is_connection_in_progress_iterator(
	uint8_t *sta_mac;
	struct hdd_context *hdd_ctx;
	mac_handle_t mac_handle;
	struct hdd_station_info *sta_info;
	struct hdd_station_info *sta_info, *tmp = NULL;
	struct hdd_is_connection_in_progress_priv *context = ctx;

	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
@@ -18462,7 +18462,7 @@ static QDF_STATUS hdd_is_connection_in_progress_iterator(
		}
	} else if ((QDF_SAP_MODE == adapter->device_mode) ||
			(QDF_P2P_GO_MODE == adapter->device_mode)) {
		hdd_for_each_sta_ref(adapter->sta_info_list, sta_info,
		hdd_for_each_sta_ref_safe(adapter->sta_info_list, sta_info, tmp,
				     STA_INFO_CONNECTION_IN_PROGRESS_ITERATOR) {
			if (sta_info->peer_state !=
				OL_TXRX_PEER_STATE_CONN) {