aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-04-08 07:08:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 16:44:45 -0400
commit7d1559f1737d5ca27b267b0392015f42b3bbe2fa (patch)
treec0dc3be7d9fd289bc2ff59fdff810c43d4e76549 /net/mac80211
parent4d6141c30a2567a85d869d55f579438b3365d719 (diff)
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')
-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)
439 return; 439 return;
440 } 440 }
441 441
442 list_del(&(*sta)->list);
443
444 if ((*sta)->flags & WLAN_STA_PS) {
445 (*sta)->flags &= ~WLAN_STA_PS;
446 if (sdata->bss)
447 atomic_dec(&sdata->bss->num_sta_ps);
448 __sta_info_clear_tim_bit(sdata->bss, *sta);
449 }
450
451 local->num_sta--;
452
453 if (local->ops->sta_notify) {
454 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN)
455 sdata = sdata->u.vlan.ap;
456
457 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
458 STA_NOTIFY_REMOVE, (*sta)->addr);
459 }
460
461 if (ieee80211_vif_is_mesh(&sdata->vif)) {
462 mesh_accept_plinks_update(sdata);
463#ifdef CONFIG_MAC80211_MESH
464 del_timer(&(*sta)->plink_timer);
465#endif
466 }
467
468#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
469 printk(KERN_DEBUG "%s: Removed STA %s\n",
470 wiphy_name(local->hw.wiphy), print_mac(mbuf, (*sta)->addr));
471#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
472
442 /* 473 /*
443 * Also pull caller's reference if the STA is pinned by the 474 * Finally, pull caller's reference if the STA is pinned by the
444 * task that is adding the debugfs entries. In that case, we 475 * task that is adding the debugfs entries. In that case, we
445 * leave the STA "to be freed". 476 * leave the STA "to be freed".
446 * 477 *
@@ -472,37 +503,6 @@ void __sta_info_unlink(struct sta_info **sta)
472 *sta = NULL; 503 *sta = NULL;
473 return; 504 return;
474 } 505 }
475
476 list_del(&(*sta)->list);
477
478 if ((*sta)->flags & WLAN_STA_PS) {
479 (*sta)->flags &= ~WLAN_STA_PS;
480 if (sdata->bss)
481 atomic_dec(&sdata->bss->num_sta_ps);
482 __sta_info_clear_tim_bit(sdata->bss, *sta);
483 }
484
485 local->num_sta--;
486
487 if (local->ops->sta_notify) {
488 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN)
489 sdata = sdata->u.vlan.ap;
490
491 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
492 STA_NOTIFY_REMOVE, (*sta)->addr);
493 }
494
495 if (ieee80211_vif_is_mesh(&sdata->vif)) {
496 mesh_accept_plinks_update(sdata);
497#ifdef CONFIG_MAC80211_MESH
498 del_timer(&(*sta)->plink_timer);
499#endif
500 }
501
502#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
503 printk(KERN_DEBUG "%s: Removed STA %s\n",
504 wiphy_name(local->hw.wiphy), print_mac(mbuf, (*sta)->addr));
505#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
506} 506}
507 507
508void sta_info_unlink(struct sta_info **sta) 508void sta_info_unlink(struct sta_info **sta)