[PATCH 1/2] wifi: ath12k: fix NULL pointer access in ath12k_mac_op_get_survey()
Aaradhana Sahu
quic_aarasahu at quicinc.com
Mon Jun 10 20:10:16 PDT 2024
Smatch throws below error
drivers/net/wireless/ath/ath12k/mac.c:8318 ath12k_mac_op_get_survey() error: we previously assumed 'sband' could be null
Currently, we access sband inside the null check of the sband
in ath12k_mac_op_get_survey().
Fix this issue by removing the entire if block, because decrement
idx is unnecessary since there are no more band to test.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Fixes: 70e3be54bbdd ("wifi: ath12k: fix survey dump collection in 6 GHz")
Signed-off-by: Aaradhana Sahu <quic_aarasahu at quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 509c02bffdae..4fea411545bc 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -8314,10 +8314,6 @@ static int ath12k_mac_op_get_survey(struct ieee80211_hw *hw, int idx,
if (!sband)
sband = hw->wiphy->bands[NL80211_BAND_6GHZ];
- if (!sband || idx >= sband->n_channels) {
- idx -= sband->n_channels;
- sband = NULL;
- }
if (!sband || idx >= sband->n_channels)
return -ENOENT;
--
2.34.1
More information about the ath12k
mailing list