@@ -1858,11 +1858,17 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
{
enum wl1271_cmd_ps_mode mode;
struct wl1271 *wl = hw->priv;
- struct ieee80211_sta *sta = ieee80211_find_sta(vif, bss_conf->bssid);
+ rcu_read_lock();
+ struct ieee80211_sta *sta;
bool do_join = false;
bool set_assoc = false;
int ret;
+ sta = ieee80211_find_sta(vif, bss_conf->bssid);
+ if (!sta) {
+ rcu_read_unlock();
+ return;
+ }
wl1271_debug(DEBUG_MAC80211, "mac80211 bss info changed");
+ rcu_read_unlock();
mutex_lock(&wl->mutex);