mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
mt76: mt7615: fix a possible NULL pointer dereference in mt7615_pm_wake_work
Initialize wcid to global_wcid if msta is NULL in mt7615_pm_wake_work
routine since wcid will be dereferenced running mt76_tx()
Fixes: 2b8cdfb28d340 ("mt76: mt7615: wake device before pushing frames in mt7615_tx")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
b8780c44c7
commit
37a1c7ed67
+2
-1
@@ -1865,12 +1865,13 @@ void mt7615_pm_wake_work(struct work_struct *work)
|
||||
spin_lock_bh(&dev->pm.txq_lock);
|
||||
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
|
||||
struct mt7615_sta *msta = dev->pm.tx_q[i].msta;
|
||||
struct mt76_wcid *wcid = msta ? &msta->wcid : NULL;
|
||||
struct ieee80211_sta *sta = NULL;
|
||||
struct mt76_wcid *wcid;
|
||||
|
||||
if (!dev->pm.tx_q[i].skb)
|
||||
continue;
|
||||
|
||||
wcid = msta ? &msta->wcid : &dev->mt76.global_wcid;
|
||||
if (msta && wcid->sta)
|
||||
sta = container_of((void *)msta, struct ieee80211_sta,
|
||||
drv_priv);
|
||||
|
||||
Reference in New Issue
Block a user