Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115020
b: refs/heads/master
c: 63044e9
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Oct 15, 2008
1 parent 50cfd96 commit 9d3f7e3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45527c2c4f698f8927239cfdec9f515cafed5f10
refs/heads/master: 63044e9f54b6bac50d2380bf4d14f63e9e7de72b
11 changes: 11 additions & 0 deletions trunk/net/mac80211/debugfs_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,22 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
DECLARE_MAC_BUF(mbuf);
u8 *mac;

sta->debugfs.add_has_run = true;

if (!stations_dir)
return;

mac = print_mac(mbuf, sta->sta.addr);

/*
* This might fail due to a race condition:
* When mac80211 unlinks a station, the debugfs entries
* remain, but it is already possible to link a new
* station with the same address which triggers adding
* it to debugfs; therefore, if the old station isn't
* destroyed quickly enough the old station's debugfs
* dir might still be around.
*/
sta->debugfs.dir = debugfs_create_dir(mac, stations_dir);
if (!sta->debugfs.dir)
return;
Expand Down
7 changes: 6 additions & 1 deletion trunk/net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,12 @@ static void sta_info_debugfs_add_work(struct work_struct *work)

spin_lock_irqsave(&local->sta_lock, flags);
list_for_each_entry(tmp, &local->sta_list, list) {
if (!tmp->debugfs.dir) {
/*
* debugfs.add_has_run will be set by
* ieee80211_sta_debugfs_add regardless
* of what else it does.
*/
if (!tmp->debugfs.add_has_run) {
sta = tmp;
__sta_info_pin(sta);
break;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/mac80211/sta_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ struct sta_info {
struct dentry *inactive_ms;
struct dentry *last_seq_ctrl;
struct dentry *agg_status;
bool add_has_run;
} debugfs;
#endif

Expand Down

0 comments on commit 9d3f7e3

Please sign in to comment.