From: Tomas Winkler Date: Tue, 25 Nov 2008 11:05:44 +0000 (+0200) Subject: mac80211: disassociate prior to unlinking AP/station X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8e268e47b8ca5bddd189320884c3cc7d9ae489f4;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git mac80211: disassociate prior to unlinking AP/station This patch reorders calls during disassociation in ieee80211_set_disassoc function. Since sta_info_unlink calls sta_notify(REMOVE) it will remove the station representing AP from the driver before it has disassociated from it using bss_info_changed callback. Signed-off-by: Tomas Winkler Signed-off-by: John W. Linville --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7600ac9b87fe..806d3ded98bd 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -855,16 +855,26 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT) ifsta->state = IEEE80211_STA_MLME_DISABLED; - sta_info_unlink(&sta); - rcu_read_unlock(); - sta_info_destroy(sta); - local->hw.conf.ht.enabled = false; ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_HT); ieee80211_bss_info_change_notify(sdata, changed); + + rcu_read_lock(); + + sta = sta_info_get(local, ifsta->bssid); + if (!sta) { + rcu_read_unlock(); + return; + } + + sta_info_unlink(&sta); + + rcu_read_unlock(); + + sta_info_destroy(sta); } static int ieee80211_sta_wep_configured(struct ieee80211_sub_if_data *sdata)