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) {