]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/sta_info.c
mac80211: use unaligned safe memcmp() in-place of compare_ether_addr()
[linux-2.6-omap-h63xx.git] / net / mac80211 / sta_info.c
index 9b72d15bc8dcb7c12978c607e057a67626c482c1..d254446b85b59d76bf3d940fce4364270a2d5bb0 100644 (file)
@@ -99,7 +99,7 @@ struct sta_info *sta_info_get(struct ieee80211_local *local, const u8 *addr)
 
        sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]);
        while (sta) {
-               if (compare_ether_addr(sta->sta.addr, addr) == 0)
+               if (memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
                        break;
                sta = rcu_dereference(sta->hnext);
        }
@@ -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;