提交 9bff2fbc 编写于 作者: L Lorenzo Bianconi 提交者: Zheng Zengkai

mt76: mt7615: check sta_rates pointer in mt7615_sta_rate_tbl_update

stable inclusion
from stable-v5.10.110
commit 2ac4f049db6e8ea930f1e74520e5f5d3d8cbf454
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2ac4f049db6e8ea930f1e74520e5f5d3d8cbf454

--------------------------------

[ Upstream commit 6a6f457e ]

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>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 4701f503
...@@ -673,6 +673,9 @@ static void mt7615_sta_rate_tbl_update(struct ieee80211_hw *hw, ...@@ -673,6 +673,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.
先完成此消息的编辑!
想要评论请 注册