diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2022-01-22 15:58:57 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-02-03 13:57:59 +0100 |
commit | fc8e2c707ce11c8ec2e992885b0d53a5e04031ac (patch) | |
tree | 7fee11d13033d2fd97097b7eeee37e6f1e435374 /drivers/net/wireless/mediatek/mt76/mt7603 | |
parent | 6152426eec691744623def0e24f7671c3845d5d7 (diff) | |
download | lwn-fc8e2c707ce11c8ec2e992885b0d53a5e04031ac.tar.gz lwn-fc8e2c707ce11c8ec2e992885b0d53a5e04031ac.zip |
mt76: mt7603: check sta_rates pointer in mt7603_sta_rate_tbl_update
Check sta_rates pointer value in mt7603_sta_rate_tbl_update routine
since minstrel_ht_update_rates can fail allocating rates array.
Fixes: c8846e1015022 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7603')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7603/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c index 2b546bc05d82..83c5eec5b163 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c @@ -641,6 +641,9 @@ mt7603_sta_rate_tbl_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta_rates *sta_rates = rcu_dereference(sta->rates); int i; + if (!sta_rates) + return; + spin_lock_bh(&dev->mt76.lock); for (i = 0; i < ARRAY_SIZE(msta->rates); i++) { msta->rates[i].idx = sta_rates->rate[i].idx; |