Browse Source

qcacld-3.0: Return error when unpermitted character is parsed in ini

Currently, when an unpermitted character is added to ini, driver
flags as an unknown config item and continues parsing. This could
be an issue. Change is to return error when invalid character is
parsed in ini.

Change-Id: I275c5093866906d5424dcd80d1cdecc98744b7ec
CRs-Fixed: 3366214
David Oladunjoye 2 years ago
parent
commit
6baed2b783
1 changed files with 10 additions and 4 deletions
  1. 10 4
      core/hdd/src/wlan_hdd_main.c

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

@@ -12861,12 +12861,18 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx)
 #ifdef CONNECTION_ROAMING_CFG
 static QDF_STATUS hdd_cfg_parse_connection_roaming_cfg(void)
 {
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_E_INVAL;
+	bool is_valid;
 
-	status = cfg_parse(WLAN_CONNECTION_ROAMING_INI_FILE);
-	if (QDF_IS_STATUS_ERROR(status))
-		status = cfg_parse(WLAN_CONNECTION_ROAMING_BACKUP_INI_FILE);
+	is_valid = cfg_valid_ini_check(WLAN_CONNECTION_ROAMING_INI_FILE);
 
+	if (is_valid)
+		status = cfg_parse(WLAN_CONNECTION_ROAMING_INI_FILE);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		is_valid = cfg_valid_ini_check(WLAN_CONNECTION_ROAMING_BACKUP_INI_FILE);
+		if (is_valid)
+			status = cfg_parse(WLAN_CONNECTION_ROAMING_BACKUP_INI_FILE);
+	}
 	return status;
 }
 #else