diff options
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index b9902e425f09..189d0bafa91a 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -249,11 +249,22 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) | |||
249 | DECLARE_MAC_BUF(mbuf); | 249 | DECLARE_MAC_BUF(mbuf); |
250 | u8 *mac; | 250 | u8 *mac; |
251 | 251 | ||
252 | sta->debugfs.add_has_run = true; | ||
253 | |||
252 | if (!stations_dir) | 254 | if (!stations_dir) |
253 | return; | 255 | return; |
254 | 256 | ||
255 | mac = print_mac(mbuf, sta->sta.addr); | 257 | mac = print_mac(mbuf, sta->sta.addr); |
256 | 258 | ||
259 | /* | ||
260 | * This might fail due to a race condition: | ||
261 | * When mac80211 unlinks a station, the debugfs entries | ||
262 | * remain, but it is already possible to link a new | ||
263 | * station with the same address which triggers adding | ||
264 | * it to debugfs; therefore, if the old station isn't | ||
265 | * destroyed quickly enough the old station's debugfs | ||
266 | * dir might still be around. | ||
267 | */ | ||
257 | sta->debugfs.dir = debugfs_create_dir(mac, stations_dir); | 268 | sta->debugfs.dir = debugfs_create_dir(mac, stations_dir); |
258 | if (!sta->debugfs.dir) | 269 | if (!sta->debugfs.dir) |
259 | return; | 270 | return; |