]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/debugfs_sta.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
[linux-2.6-omap-h63xx.git] / net / mac80211 / debugfs_sta.c
index 81f350eaf8a3dfc68b8b2e8c94d1cd9794828c82..189d0bafa91ae0f274c2813f912012679f53903d 100644 (file)
@@ -173,8 +173,7 @@ static ssize_t sta_agg_status_write(struct file *file,
                const char __user *user_buf, size_t count, loff_t *ppos)
 {
        struct sta_info *sta = file->private_data;
-       struct net_device *dev = sta->sdata->dev;
-       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+       struct ieee80211_local *local = sta->sdata->local;
        struct ieee80211_hw *hw = &local->hw;
        u8 *da = sta->sta.addr;
        static int tid_static_tx[16] = {0, 0, 0, 0, 0, 0, 0, 0,
@@ -250,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;