From 2a0a19168dced086fc50085e65232bd544bb55bc Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 11 Oct 2019 16:03:37 +0200 Subject: [PATCH] mt7603: remove vif sta from poll list on interface remove Signed-off-by: Felix Fietkau --- mt7603/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mt7603/main.c b/mt7603/main.c index c4dac556..f5b49961 100644 --- a/mt7603/main.c +++ b/mt7603/main.c @@ -88,8 +88,9 @@ static void mt7603_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct mt7603_vif *mvif = (struct mt7603_vif *)vif->drv_priv; + struct mt7603_sta *msta = &mvif->sta; struct mt7603_dev *dev = hw->priv; - int idx = mvif->sta.wcid.idx; + int idx = msta->wcid.idx; mt76_wr(dev, MT_MAC_ADDR0(mvif->idx), 0); mt76_wr(dev, MT_MAC_ADDR1(mvif->idx), 0); @@ -100,6 +101,11 @@ mt7603_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) rcu_assign_pointer(dev->mt76.wcid[idx], NULL); mt76_txq_remove(&dev->mt76, vif->txq); + spin_lock_bh(&dev->sta_poll_lock); + if (!list_empty(&msta->poll_list)) + list_del_init(&msta->poll_list); + spin_unlock_bh(&dev->sta_poll_lock); + mutex_lock(&dev->mt76.mutex); dev->vif_mask &= ~BIT(mvif->idx); mutex_unlock(&dev->mt76.mutex);