Skip to content

Commit

Permalink
wifi: mac80211: properly set old_links when removing a link
Browse files Browse the repository at this point in the history
[ Upstream commit a8f6239 ]

In ieee80211_sta_remove_link, valid_links is set to
the new_links before calling drv_change_sta_links, but
is used for the old_links.

Fixes: cb71f1d ("wifi: mac80211: add sta link addition/removal")
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
striebit authored and gregkh committed Oct 21, 2022
1 parent aed931f commit 6b7a818
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -2799,15 +2799,15 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)
void ieee80211_sta_remove_link(struct sta_info *sta, unsigned int link_id)
{
struct ieee80211_sub_if_data *sdata = sta->sdata;
u16 old_links = sta->sta.valid_links;

lockdep_assert_held(&sdata->local->sta_mtx);

sta->sta.valid_links &= ~BIT(link_id);

if (test_sta_flag(sta, WLAN_STA_INSERTED))
drv_change_sta_links(sdata->local, sdata, &sta->sta,
sta->sta.valid_links,
sta->sta.valid_links & ~BIT(link_id));
old_links, sta->sta.valid_links);

sta_remove_link(sta, link_id, true);
}
Expand Down

0 comments on commit 6b7a818

Please sign in to comment.