Skip to content

Commit

Permalink
staging: wfx: fix RCU usage
Browse files Browse the repository at this point in the history
Indeed, sta was used after call to rcu_unlock()

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-49-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jérôme Pouiller authored and Greg Kroah-Hartman committed Jan 16, 2020
1 parent 76b5c2c commit d001490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/wfx/sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,9 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
struct ieee80211_sta *sta = NULL;

wvif->beacon_int = info->beacon_int;
rcu_read_lock();
rcu_read_lock(); // protect sta
if (info->bssid && !info->ibss_joined)
sta = ieee80211_find_sta(wvif->vif, info->bssid);
rcu_read_unlock();
if (sta)
wvif->bss_params.operational_rate_set =
wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]);
Expand All @@ -712,6 +711,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
wvif->bss_params.aid = info->aid;

hif_set_association_mode(wvif, info, sta ? &sta->ht_cap : NULL);
rcu_read_unlock();

if (!info->ibss_joined) {
hif_keep_alive_period(wvif, 30 /* sec */);
Expand Down

0 comments on commit d001490

Please sign in to comment.