{
struct mt76_chanctx *ctx = (struct mt76_chanctx *)conf->drv_priv;
struct mt76_vif_link *mlink = (struct mt76_vif_link *)vif->drv_priv;
- struct mt76_vif_data *mvif = mlink->mvif;
- int link_id = link_conf->link_id;
struct mt76_phy *phy = ctx->phy;
struct mt76_dev *dev = phy->dev;
if (!mlink)
goto out;
- if (mlink != (struct mt76_vif_link *)vif->drv_priv)
- rcu_assign_pointer(mvif->link[link_id], NULL);
-
dev->drv->vif_link_remove(phy, vif, link_conf, mlink);
mlink->ctx = NULL;
-
- if (mlink != (struct mt76_vif_link *)vif->drv_priv)
- kfree_rcu(mlink, rcu_head);
-
out:
mutex_unlock(&dev->mutex);
}
spin_unlock_bh(&dev->mt76.sta_poll_lock);
mt76_wcid_cleanup(&dev->mt76, &msta_link->wcid);
+
+ if (mlink != (struct mt76_vif_link *)vif->drv_priv &&
+ !mlink->wcid->offchannel) {
+ rcu_assign_pointer(mlink->mvif->link[link_id], NULL);
+ kfree_rcu(mlink, rcu_head);
+ }
}
static void mt7996_phy_set_rxfilter(struct mt7996_phy *phy)