aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-01-18 15:21:31 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-24 10:07:58 -0500
commit782d2673655c05a1c0335fe0ee4cb62c23bcc231 (patch)
treeaf61e03bf4fb2a5963120d16c71926b8bfd84310 /net/mac80211/mlme.c
parent683d41ae6755e6ae297ec09603c229795ab9566e (diff)
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: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 62e8f890fed6..5913fb924b12 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3156,23 +3156,22 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata)
3156{ 3156{
3157 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 3157 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3158 3158
3159 if (!ifmgd->associated) 3159 mutex_lock(&ifmgd->mtx);
3160 if (!ifmgd->associated) {
3161 mutex_unlock(&ifmgd->mtx);
3160 return; 3162 return;
3163 }
3161 3164
3162 if (sdata->flags & IEEE80211_SDATA_DISCONNECT_RESUME) { 3165 if (sdata->flags & IEEE80211_SDATA_DISCONNECT_RESUME) {
3163 sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; 3166 sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME;
3164 mutex_lock(&ifmgd->mtx); 3167 mlme_dbg(sdata, "driver requested disconnect after resume\n");
3165 if (ifmgd->associated) { 3168 ieee80211_sta_connection_lost(sdata,
3166 mlme_dbg(sdata, 3169 ifmgd->associated->bssid,
3167 "driver requested disconnect after resume\n"); 3170 WLAN_REASON_UNSPECIFIED);
3168 ieee80211_sta_connection_lost(sdata,
3169 ifmgd->associated->bssid,
3170 WLAN_REASON_UNSPECIFIED);
3171 mutex_unlock(&ifmgd->mtx);
3172 return;
3173 }
3174 mutex_unlock(&ifmgd->mtx); 3171 mutex_unlock(&ifmgd->mtx);
3172 return;
3175 } 3173 }
3174 mutex_unlock(&ifmgd->mtx);
3176 3175
3177 if (test_and_clear_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running)) 3176 if (test_and_clear_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running))
3178 add_timer(&ifmgd->timer); 3177 add_timer(&ifmgd->timer);