Browse Source

qcacmn: Avoid array out of bound access

Avoid array out of bound access by validating monitor channel band value.

Change-Id: I3b9c272e1fcf0d83a8d08884037af1eeed0a87ce
CRs-Fixed: 3501636
Srinivas Girigowda 2 years ago
parent
commit
c953dbb12d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      dp/wifi3.0/monitor/1.0/dp_mon_1.0.c

+ 3 - 0
dp/wifi3.0/monitor/1.0/dp_mon_1.0.c

@@ -193,6 +193,9 @@ void dp_flush_monitor_rings(struct dp_soc *soc)
 		dp_info("failed to reset monitor filters");
 	qdf_spin_unlock_bh(&mon_pdev->mon_lock);
 
+	if (qdf_unlikely(mon_pdev->mon_chan_band >= REG_BAND_UNKNOWN))
+		return;
+
 	lmac_id = pdev->ch_band_lmac_id_mapping[mon_pdev->mon_chan_band];
 	if (qdf_unlikely(lmac_id == DP_MON_INVALID_LMAC_ID))
 		return;