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
This commit is contained in:
Srinivas Dasari
2022-04-29 12:29:02 +05:30
committed by Madan Koyyalamudi
부모 dcf35b71db
커밋 57bfa343e8

파일 보기

@@ -19700,7 +19700,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);
@@ -19764,7 +19764,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) {