ソースを参照

qcacld-3.0: Sanity check for channel width

For channel width not have the sanity whenever the
value is zero or greater than 40MHz in 2.4GHz.

Added sanity check for channel width more than
40MHz for 2.4Ghz and channel width is zero.

Change-Id: I60883dcc5afd1e381cea1d3c9ef49a55d688298b
CRs-Fixed: 3181700
Vinod Kumar Myadam 2 年 前
コミット
134a569261
1 ファイル変更4 行追加2 行削除
  1. 4 2
      core/wma/src/wma_features.c

+ 4 - 2
core/wma/src/wma_features.c

@@ -684,8 +684,10 @@ enum wlan_phymode wma_chan_phy_mode(uint32_t freq, enum phy_ch_width chan_width,
 	if (!wma)
 		return WLAN_PHYMODE_AUTO;
 
-	if (chan_width >= CH_WIDTH_INVALID) {
-		wma_err_rl("Invalid channel width %d", chan_width);
+	if (chan_width >= CH_WIDTH_INVALID || !bw_val ||
+	    (wlan_reg_is_24ghz_ch_freq(freq) && bw_val > 40)) {
+		wma_err_rl("Invalid channel width %d freq %d",
+			   chan_width, freq);
 		return WLAN_PHYMODE_AUTO;
 	}