diff options
Diffstat (limited to 'sys/contrib/dev/mediatek/mt76/channel.c')
| -rw-r--r-- | sys/contrib/dev/mediatek/mt76/channel.c | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/sys/contrib/dev/mediatek/mt76/channel.c b/sys/contrib/dev/mediatek/mt76/channel.c index 6a35c6ebd823..77b75792eb48 100644 --- a/sys/contrib/dev/mediatek/mt76/channel.c +++ b/sys/contrib/dev/mediatek/mt76/channel.c @@ -173,13 +173,13 @@ void mt76_unassign_vif_chanctx(struct ieee80211_hw *hw,  	if (!mlink)  		goto out; -	if (link_conf != &vif->bss_conf) +	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 (link_conf != &vif->bss_conf) +	if (mlink != (struct mt76_vif_link *)vif->drv_priv)  		kfree_rcu(mlink, rcu_head);  out: @@ -293,6 +293,7 @@ struct mt76_vif_link *mt76_get_vif_phy_link(struct mt76_phy *phy,  		kfree(mlink);  		return ERR_PTR(ret);  	} +	rcu_assign_pointer(mvif->offchannel_link, mlink);  	return mlink;  } @@ -301,10 +302,14 @@ void mt76_put_vif_phy_link(struct mt76_phy *phy, struct ieee80211_vif *vif,  			   struct mt76_vif_link *mlink)  {  	struct mt76_dev *dev = phy->dev; +	struct mt76_vif_data *mvif;  	if (IS_ERR_OR_NULL(mlink) || !mlink->offchannel)  		return; +	mvif = mlink->mvif; + +	rcu_assign_pointer(mvif->offchannel_link, NULL);  	dev->drv->vif_link_remove(phy, vif, &vif->bss_conf, mlink);  	kfree(mlink);  } | 
