From d8a5c680396e3b4bfc5059b9ab0336539a7051dd Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Tue, 10 May 2022 15:46:55 +0530 Subject: [PATCH] qcacld-3.0: Fix ref leak for temp sta info node hdd_is_connection_in_progress_iterator loops through all adapters and the sta_info present in each adapter to find out if any connection is in progress. In SAP case, there could be multiple sta_info present and need to traverse through them by avoiding running into loop on the same sta_info/released sta_info. The hdd_for_each_sta_ref_safe helps for the same but takes two references, one for sta_info and one for a temporary entry. Release both after checking the connection status. Change-Id: I58a49e12b6d581dbaf1c129ce5a5196b31fb432f CRs-Fixed: 3188412 --- core/hdd/src/wlan_hdd_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 10824450579b..8663fc44b3c3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -18551,6 +18551,10 @@ static QDF_STATUS hdd_is_connection_in_progress_iterator( hdd_put_sta_info_ref( &adapter->sta_info_list, &sta_info, true, STA_INFO_CONNECTION_IN_PROGRESS_ITERATOR); + if (tmp) + hdd_put_sta_info_ref( + &adapter->sta_info_list, &tmp, true, + STA_INFO_CONNECTION_IN_PROGRESS_ITERATOR); return QDF_STATUS_E_ABORTED; }