Commit 782d2673 authored by Johannes Berg's avatar Johannes Berg

mac80211: remove redundant check

There's no need to have two checks for "associated"
in ieee80211_sta_restart(), make the first one locked
to not race (unlikely at this point during resume)
and remove the second check.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 683d41ae
...@@ -3156,23 +3156,22 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata) ...@@ -3156,23 +3156,22 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata)
{ {
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
if (!ifmgd->associated) mutex_lock(&ifmgd->mtx);
if (!ifmgd->associated) {
mutex_unlock(&ifmgd->mtx);
return; return;
}
if (sdata->flags & IEEE80211_SDATA_DISCONNECT_RESUME) { if (sdata->flags & IEEE80211_SDATA_DISCONNECT_RESUME) {
sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME;
mutex_lock(&ifmgd->mtx); mlme_dbg(sdata, "driver requested disconnect after resume\n");
if (ifmgd->associated) { ieee80211_sta_connection_lost(sdata,
mlme_dbg(sdata, ifmgd->associated->bssid,
"driver requested disconnect after resume\n"); WLAN_REASON_UNSPECIFIED);
ieee80211_sta_connection_lost(sdata,
ifmgd->associated->bssid,
WLAN_REASON_UNSPECIFIED);
mutex_unlock(&ifmgd->mtx);
return;
}
mutex_unlock(&ifmgd->mtx); mutex_unlock(&ifmgd->mtx);
return;
} }
mutex_unlock(&ifmgd->mtx);
if (test_and_clear_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running)) if (test_and_clear_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running))
add_timer(&ifmgd->timer); add_timer(&ifmgd->timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment