From: Jérôme Pouiller Date: Wed, 15 Jan 2020 13:55:12 +0000 (+0000) Subject: staging: wfx: fix RCU usage X-Git-Tag: v5.6-rc1~138^2~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d00149011066bde86cd56c64b77616c40a4f83af;p=thirdparty%2Fkernel%2Flinux.git staging: wfx: fix RCU usage Indeed, sta was used after call to rcu_unlock() Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200115135338.14374-49-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1c10ebd119440..cc72877a090f2 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -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]); @@ -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 */);