From 27cb5157952ea3afea4adf0d51151c3336e2d902 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Fri, 29 Apr 2022 12:29:02 +0530 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8f9b4ca913ad..fe81ae63ecfd 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -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) {