Jelajahi Sumber

qcacld-3.0: free osif request in wlan_cfg80211_coap_cache_get_cbk()

The osif request allocated in wlan_cfg80211_coap_cache_get_cbk()
is not freed for cases other than completed case, which will
result in memory leak in those cases.
To fix it, free osif request for all the cases.

Change-Id: I17998d0fb39e75b8b5f52a26d351056222c95536
CRs-Fixed: 3275889
Yu Wang 2 tahun lalu
induk
melakukan
10b9de1c0f
1 mengubah file dengan 5 tambahan dan 7 penghapusan
  1. 5 7
      os_if/coap/src/wlan_cfg80211_coap.c

+ 5 - 7
os_if/coap/src/wlan_cfg80211_coap.c

@@ -382,14 +382,12 @@ wlan_cfg80211_coap_cache_get_cbk(void *context, struct coap_buf_info *info)
 		return;
 
 	priv_info = osif_request_priv(request);
-	if (info->req_id != priv_info->req_id)
-		return;
-
-	qdf_list_join(&priv_info->info_list, &info->info_list);
-	if (info->more_info)
-		return;
+	if (info->req_id == priv_info->req_id) {
+		qdf_list_join(&priv_info->info_list, &info->info_list);
+		if (!info->more_info)
+			osif_request_complete(request);
+	}
 
-	osif_request_complete(request);
 	osif_request_put(request);
 }