summaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-04-08 13:08:20 +0200
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 22:44:45 +0200
commit7d1559f1737d5ca27b267b0392015f42b3bbe2fa (patch)
treec0dc3be7d9fd289bc2ff59fdff810c43d4e76549 /net/mac80211/sta_info.c
parentmac80211: fix defined but not used (diff)
downloadlinux-7d1559f1737d5ca27b267b0392015f42b3bbe2fa.tar.xz
linux-7d1559f1737d5ca27b267b0392015f42b3bbe2fa.zip
mac80211: fix sta-info pinning
When a STA is supposed to be unlinked but is pinned, it still needs to be unlinked from all structures. Only at the end of the unlink process should we check for pin status and invalidate the callers reference if it is pinned. Move the pin status check down. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 130aad2de108..cedd73a0c875 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -439,8 +439,39 @@ void __sta_info_unlink(struct sta_info **sta)
return;
}
+ list_del(&(*sta)->list);
+
+ if ((*sta)->flags & WLAN_STA_PS) {
+ (*sta)->flags &= ~WLAN_STA_PS;
+ if (sdata->bss)
+ atomic_dec(&sdata->bss->num_sta_ps);
+ __sta_info_clear_tim_bit(sdata->bss, *sta);
+ }
+
+ local->num_sta--;
+
+ if (local->ops->sta_notify) {
+ if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN)
+ sdata = sdata->u.vlan.ap;
+
+ local->ops->sta_notify(local_to_hw(local), &sdata->vif,
+ STA_NOTIFY_REMOVE, (*sta)->addr);
+ }
+
+ if (ieee80211_vif_is_mesh(&sdata->vif)) {
+ mesh_accept_plinks_update(sdata);
+#ifdef CONFIG_MAC80211_MESH
+ del_timer(&(*sta)->plink_timer);
+#endif
+ }
+
+#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
+ printk(KERN_DEBUG "%s: Removed STA %s\n",
+ wiphy_name(local->hw.wiphy), print_mac(mbuf, (*sta)->addr));
+#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
+
/*
- * Also pull caller's reference if the STA is pinned by the
+ * Finally, pull caller's reference if the STA is pinned by the
* task that is adding the debugfs entries. In that case, we
* leave the STA "to be freed".
*
@@ -472,37 +503,6 @@ void __sta_info_unlink(struct sta_info **sta)
*sta = NULL;
return;
}
-
- list_del(&(*sta)->list);
-
- if ((*sta)->flags & WLAN_STA_PS) {
- (*sta)->flags &= ~WLAN_STA_PS;
- if (sdata->bss)
- atomic_dec(&sdata->bss->num_sta_ps);
- __sta_info_clear_tim_bit(sdata->bss, *sta);
- }
-
- local->num_sta--;
-
- if (local->ops->sta_notify) {
- if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN)
- sdata = sdata->u.vlan.ap;
-
- local->ops->sta_notify(local_to_hw(local), &sdata->vif,
- STA_NOTIFY_REMOVE, (*sta)->addr);
- }
-
- if (ieee80211_vif_is_mesh(&sdata->vif)) {
- mesh_accept_plinks_update(sdata);
-#ifdef CONFIG_MAC80211_MESH
- del_timer(&(*sta)->plink_timer);
-#endif
- }
-
-#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
- printk(KERN_DEBUG "%s: Removed STA %s\n",
- wiphy_name(local->hw.wiphy), print_mac(mbuf, (*sta)->addr));
-#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
}
void sta_info_unlink(struct sta_info **sta)