mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: prevent NULL vif dereference in mt7925_mac_write_txwi
Check for a NULL `vif` before accessing `ieee80211_vif_is_mld(vif)` to
avoid a potential kernel panic in scenarios where `vif` might not be
initialized.
Fixes: ebb1406813c6 ("wifi: mt76: mt7925: add link handling to txwi")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
f271ce48d7
commit
d48b221e39
+2
-2
@@ -802,8 +802,8 @@ mt7925_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
|
|||||||
txwi[5] = cpu_to_le32(val);
|
txwi[5] = cpu_to_le32(val);
|
||||||
|
|
||||||
val = MT_TXD6_DAS | FIELD_PREP(MT_TXD6_MSDU_CNT, 1);
|
val = MT_TXD6_DAS | FIELD_PREP(MT_TXD6_MSDU_CNT, 1);
|
||||||
if (!ieee80211_vif_is_mld(vif) ||
|
if (vif && (!ieee80211_vif_is_mld(vif) ||
|
||||||
(q_idx >= MT_LMAC_ALTX0 && q_idx <= MT_LMAC_BCN0))
|
(q_idx >= MT_LMAC_ALTX0 && q_idx <= MT_LMAC_BCN0)))
|
||||||
val |= MT_TXD6_DIS_MAT;
|
val |= MT_TXD6_DIS_MAT;
|
||||||
txwi[6] = cpu_to_le32(val);
|
txwi[6] = cpu_to_le32(val);
|
||||||
txwi[7] = 0;
|
txwi[7] = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user