wifi: mt76: mt7996: Switch deflink to seclink only if link lookup does not fail

Do not switch default link to the secondary link in
mt7996_mac_sta_remove_links routine if the lookup for the secondary
msta_link fails.

Fixes: d7e5444f9eb02 ("wifi: mt76: mt7996: Switch to the secondary link if the default one is removed")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2026-03-21 08:22:45 +00:00
committed by Felix Fietkau
parent 1b26f5f63d
commit 0c1dedac48
+5 -4
View File
@@ -1155,21 +1155,22 @@ mt7996_mac_sta_remove_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
phy->mt76->num_sta--;
if (msta->deflink_id == link_id) {
if (msta->seclink_id == msta->deflink_id) {
msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
if (msta->seclink_id == link_id) {
/* no secondary link available */
msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
msta->seclink_id = msta->deflink_id;
} else {
struct mt7996_sta_link *msta_seclink;
/* switch to the secondary link */
msta->deflink_id = msta->seclink_id;
msta_seclink = mt76_dereference(
msta->link[msta->seclink_id],
mdev);
if (msta_seclink)
if (msta_seclink) {
msta->deflink_id = msta->seclink_id;
mt7996_sta_init_txq_wcid(sta,
msta_seclink->wcid.idx);
}
}
} else if (msta->seclink_id == link_id) {
msta->seclink_id = msta->deflink_id;