mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: fix vif link allocation
Reuse the vif deflink for link_id = 0 in order to avoid confusion with vif->bss_conf, which also gets a link id of 0. Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -1880,6 +1880,9 @@ mt76_vif_link(struct mt76_dev *dev, struct ieee80211_vif *vif, int link_id)
|
||||
struct mt76_vif_link *mlink = (struct mt76_vif_link *)vif->drv_priv;
|
||||
struct mt76_vif_data *mvif = mlink->mvif;
|
||||
|
||||
if (!link_id)
|
||||
return mlink;
|
||||
|
||||
return mt76_dereference(mvif->link[link_id], dev);
|
||||
}
|
||||
|
||||
@@ -1890,7 +1893,7 @@ mt76_vif_conf_link(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
||||
struct mt76_vif_link *mlink = (struct mt76_vif_link *)vif->drv_priv;
|
||||
struct mt76_vif_data *mvif = mlink->mvif;
|
||||
|
||||
if (link_conf == &vif->bss_conf)
|
||||
if (link_conf == &vif->bss_conf || !link_conf->link_id)
|
||||
return mlink;
|
||||
|
||||
return mt76_dereference(mvif->link[link_conf->link_id], dev);
|
||||
|
||||
Reference in New Issue
Block a user