Browse Source

qcacld-3.0: Fix a memory leak in hdd_assoc handler

Function wlan_hdd_cfg80211_update_bss_db will return pointer of
struct cfg80211_bss.
Caller should invoke cfg80211_put_bss to free resource in pointer.
In some case those resource not be free.

Change-Id: I7fa55a09fcc3515361e9568cf87966e4533085e4
CRs-Fixed: 2146717
Jiachao Wu 7 years ago
parent
commit
0411bc9be0
1 changed files with 4 additions and 4 deletions
  1. 4 4
      core/hdd/src/wlan_hdd_assoc.c

+ 4 - 4
core/hdd/src/wlan_hdd_assoc.c

@@ -2787,6 +2787,10 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 					   eCSR_DISCONNECT_REASON_UNSPECIFIED);
 				}
 				return QDF_STATUS_E_FAILURE;
+			} else {
+				cfg80211_put_bss(
+					hdd_ctx->wiphy,
+					bss);
 			}
 			if (roam_info->u.pConnectedProfile->AuthType ==
 			    eCSR_AUTH_TYPE_FT_RSN
@@ -3003,10 +3007,6 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 				}
 			}
 			if (!hddDisconInProgress) {
-				cfg80211_put_bss(
-					hdd_ctx->wiphy,
-					bss);
-
 				/*
 				 * Perform any WMM-related association
 				 * processing.