qcacld-3.0: Fix resource leaks when change con_mode

Avoid resource leaks on PCIe targets, call close adapters before
stop modules.

Change-Id: If06be4c9627eb345fb52609351417b155d336a4e
CRs-Fixed: 2164930
This commit is contained in:
Frank Liu
2018-01-04 10:06:05 +08:00
committed by snandini
父節點 d16a285d82
當前提交 6666f83f73

查看文件

@@ -12191,17 +12191,23 @@ static int __con_mode_handler(const char *kmessage, struct kernel_param *kp,
/* ensure adapters are stopped */
hdd_stop_present_mode(hdd_ctx, curr_mode);
/* Cleanup present mode before switching to new mode */
hdd_cleanup_present_mode(hdd_ctx, curr_mode);
ret = hdd_wlan_stop_modules(hdd_ctx, true);
if (ret) {
hdd_err("Stop wlan modules failed");
goto reset_flags;
}
/* Cleanup present mode before switching to new mode */
hdd_cleanup_present_mode(hdd_ctx, curr_mode);
hdd_set_conparam(new_con_mode);
/*
* Set ACTIVE domain before adapters created, otherwise check domain
* match will fail when cleanup adapters.
*/
hdd_debug_domain_set(QDF_DEBUG_DOMAIN_ACTIVE);
/* Register for new con_mode & then kick_start modules again */
ret = hdd_register_req_mode(hdd_ctx, new_con_mode);
if (ret) {