lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6.0 238/862] wifi: mac80211: properly set old_links when removing a link
    Date
    From: Shaul Triebitz <shaul.triebitz@intel.com>

    [ Upstream commit a8f62399daa6917e7f9efeb79bce4dd2cd494a1e ]

    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: cb71f1d136a6 ("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>
    ---
    net/mac80211/sta_info.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
    index 58998d821778..9d7b238a6737 100644
    --- a/net/mac80211/sta_info.c
    +++ b/net/mac80211/sta_info.c
    @@ -2799,6 +2799,7 @@ 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);

    @@ -2806,8 +2807,7 @@ void ieee80211_sta_remove_link(struct sta_info *sta, unsigned int 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);
    }
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-10-19 15:59    [W:4.886 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site