Browse Source

qcacld-3.0: Open WLAN adapter in FTM mode after modules are started

According to the current code flow of con_mode_handler, the
WLAN modules are stopped, adapter is opened in FTM mode and then
the modules are started. Due to the INI/CFG value accces done as
part of opening the adapter, and since the modules are stopped
at this point, it results in a use after free scenario.

Modify code sequence of con_mode_handler to WLAN start modules
before opening the adapter in FTM mode.

Change-Id: I94afb9b2a3751247b4ae95e27b1374b25890a9d7
CRs-Fixed: 2339777
jitiphil 6 years ago
parent
commit
7af5cf252a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      core/hdd/src/wlan_hdd_main.c

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

@@ -13326,15 +13326,15 @@ static int __con_mode_handler(const char *kmessage,
 
 	hdd_set_conparam(next_mode);
 
-	errno = hdd_open_adapters_for_mode(hdd_ctx, next_mode);
+	errno = hdd_wlan_start_modules(hdd_ctx, false);
 	if (errno) {
-		hdd_err("Failed to open adapters");
+		hdd_err("Start wlan modules failed: %d", errno);
 		goto unlock;
 	}
 
-	errno = hdd_wlan_start_modules(hdd_ctx, false);
+	errno = hdd_open_adapters_for_mode(hdd_ctx, next_mode);
 	if (errno) {
-		hdd_err("Start wlan modules failed: %d", errno);
+		hdd_err("Failed to open adapters");
 		goto unlock;
 	}