Ver código fonte

qcacld-3.0: Allocate and free memory for chan_info correctly

Memory for chan_info is allocated in hdd_wlan_startup() and
freed in hdd_wlan_exit(). When device boots up, memory gets
allocated for chan_info but if interface timer expires, all
the modules are closed and memory is checked for any leaks.
As memory for chan_info is freed in hdd_wlan_exit() so memory
for chan_info is still present and hence assert in
qdf_mem_check_for_leaks().

Allocate memory for chan_info in hdd_features_init() and free
it in hdd_features_deinit().

Change-Id: Ia8944da16a776d4de4fdfbb10b605ebd2b60f0b6
CRs-Fixed: 2178435
Dustin Brown 7 anos atrás
pai
commit
11638b7c0b
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      core/hdd/src/wlan_hdd_main.c

+ 3 - 3
core/hdd/src/wlan_hdd_main.c

@@ -6391,7 +6391,6 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx)
 	hdd_ipa_cleanup(hdd_ctx);
 
 	wlansap_global_deinit();
-	wlan_hdd_deinit_chan_info(hdd_ctx);
 	/*
 	 * If there is re_init failure wiphy would have already de-registered
 	 * check the wiphy status before un-registering again
@@ -9788,6 +9787,8 @@ static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *ad
 	if (ret)
 		goto deregister_cb;
 
+	wlan_hdd_init_chan_info(hdd_ctx);
+
 	EXIT();
 	return 0;
 
@@ -9810,6 +9811,7 @@ out:
  */
 static void hdd_features_deinit(struct hdd_context *hdd_ctx)
 {
+	wlan_hdd_deinit_chan_info(hdd_ctx);
 	wlan_hdd_tsf_deinit(hdd_ctx);
 }
 
@@ -10408,8 +10410,6 @@ int hdd_wlan_startup(struct device *dev)
 	if (hdd_ipa_init(hdd_ctx) == QDF_STATUS_E_FAILURE)
 		goto err_wiphy_unregister;
 
-	wlan_hdd_init_chan_info(hdd_ctx);
-
 	hdd_initialize_mac_address(hdd_ctx);
 
 	ret = register_netdevice_notifier(&hdd_netdev_notifier);