Browse Source

qcacld-3.0: Validate 2.4 GHz band before accessing it

Add a safety check to verify if the 2.4GHz band is
enabled/supported before updating the target config.

Change-Id: I05c0ac956acee0cd9550114836a0d41cfc3359ed
CRs-Fixed: 2883567
Aditya Kodukula 4 years ago
parent
commit
62d13fc520
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/hdd/src/wlan_hdd_main.c

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

@@ -1823,7 +1823,13 @@ static void hdd_update_wiphy_vhtcap(struct hdd_context *hdd_ctx)
 
 	ucfg_mlme_cfg_get_vht_tx_mcs_map(hdd_ctx->psoc, &value2);
 	band_5g->vht_cap.vht_mcs.tx_mcs_map = value2;
+
+	if (!band_2g) {
+		hdd_debug("2GHz band disabled, skipping capability population");
+		return;
+	}
 	ucfg_mlme_get_vht_for_24ghz(hdd_ctx->psoc, &is_vht_24ghz);
+
 	if (is_vht_24ghz)
 		band_2g->vht_cap.vht_mcs.tx_mcs_map = value2;
 }