提交 6a6f457e 编写于 作者: L Lorenzo Bianconi 提交者: Felix Fietkau

mt76: mt7615: check sta_rates pointer in mt7615_sta_rate_tbl_update

Check sta_rates pointer value in mt7615_sta_rate_tbl_update routine
since minstrel_ht_update_rates can fail allocating rates array.

Fixes: 04b8e659 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: NLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: NFelix Fietkau <nbd@nbd.name>
上级 fc8e2c70
...@@ -689,6 +689,9 @@ static void mt7615_sta_rate_tbl_update(struct ieee80211_hw *hw, ...@@ -689,6 +689,9 @@ static void mt7615_sta_rate_tbl_update(struct ieee80211_hw *hw,
struct ieee80211_sta_rates *sta_rates = rcu_dereference(sta->rates); struct ieee80211_sta_rates *sta_rates = rcu_dereference(sta->rates);
int i; int i;
if (!sta_rates)
return;
spin_lock_bh(&dev->mt76.lock); spin_lock_bh(&dev->mt76.lock);
for (i = 0; i < ARRAY_SIZE(msta->rates); i++) { for (i = 0; i < ARRAY_SIZE(msta->rates); i++) {
msta->rates[i].idx = sta_rates->rate[i].idx; msta->rates[i].idx = sta_rates->rate[i].idx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册