Prechádzať zdrojové kódy

qcacld-3.0: Do not process invalid reg update request

Do not process the reg notifier request if the regulatory
information is invalid

Change-Id: I13e288cd03e3fbdb192733a6675c7ec00e927250
CRs-Fixed: 2145505
Kiran Kumar Lokere 7 rokov pred
rodič
commit
a6e01c070b

+ 5 - 0
core/cds/src/cds_regdomain.c

@@ -685,6 +685,11 @@ void cds_fill_and_send_ctl_to_fw(struct regulatory *reg)
 		return;
 	}
 
+	if (!reg->regpair) {
+		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+			  FL("no regpair is found, can not proceed"));
+		return;
+	}
 	regpair = reg->regpair;
 	reg_dmn_2g = get_reg_dmn(regpair->reg_dmn_2ghz);
 	if (!reg_dmn_2g) {

+ 0 - 1
core/hdd/src/wlan_hdd_main.c

@@ -9074,7 +9074,6 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx)
 		goto out;
 	}
 
-
 	status = hdd_set_sme_chan_list(hdd_ctx);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("Failed to init channel list: %d", status);

+ 9 - 4
core/hdd/src/wlan_hdd_regulatory.c

@@ -180,9 +180,9 @@ static bool hdd_is_world_regdomain(uint32_t reg_domain)
  * hdd_update_regulatory_info() - update regulatory info
  * @hdd_ctx: hdd context
  *
- * Return: void
+ * Return: Error Code
  */
-static void hdd_update_regulatory_info(struct hdd_context *hdd_ctx)
+static int hdd_update_regulatory_info(struct hdd_context *hdd_ctx)
 {
 	uint32_t country_code;
 
@@ -191,7 +191,7 @@ static void hdd_update_regulatory_info(struct hdd_context *hdd_ctx)
 	hdd_ctx->reg.reg_domain = CTRY_FLAG;
 	hdd_ctx->reg.reg_domain |= country_code;
 
-	cds_fill_some_regulatory_info(&hdd_ctx->reg);
+	return cds_fill_some_regulatory_info(&hdd_ctx->reg);
 
 }
 
@@ -689,6 +689,7 @@ void hdd_reg_notifier(struct wiphy *wiphy,
 	bool reset = false;
 	enum dfs_reg dfs_reg;
 	struct reg_config_vars config_vars;
+	int ret_val;
 
 	hdd_debug("country: %c%c, initiator %d, dfs_region: %d",
 		  request->alpha2[0],
@@ -769,7 +770,11 @@ void hdd_reg_notifier(struct wiphy *wiphy,
 		hdd_ctx->reg.alpha2[0] = request->alpha2[0];
 		hdd_ctx->reg.alpha2[1] = request->alpha2[1];
 
-		hdd_update_regulatory_info(hdd_ctx);
+		ret_val = hdd_update_regulatory_info(hdd_ctx);
+		if (ret_val) {
+			hdd_err("invalid reg info, do not process");
+			return;
+		}
 
 		hdd_process_regulatory_data(hdd_ctx, wiphy, reset);