Move acquisition of node reference outside macro to ensure node is referenced only...
authormentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sat, 27 Oct 2007 17:58:32 +0000 (17:58 +0000)
committermentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sat, 27 Oct 2007 17:58:32 +0000 (17:58 +0000)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2792 0192ed92-7a03-0410-a25b-9323aeb14dbd

net80211/ieee80211_node.c

index 98f8f1d90579489e571b2413330d6c3a2c8cfdce..c20ccc884ef1443f3eaabd24b6dec5bc513cf08d 100644 (file)
@@ -733,10 +733,14 @@ ieee80211_node_table_init(struct ieee80211com *ic, struct ieee80211_node_table *
 }
 
 static __inline void _node_table_join(struct ieee80211_node_table *nt, struct ieee80211_node *ni) {
+       struct ieee80211_node *tni = NULL;
        IEEE80211_NODE_TABLE_LOCK_ASSERT(nt);
 
        ni->ni_table = nt;
-       TAILQ_INSERT_TAIL(&nt->nt_node, ieee80211_ref_node(ni), ni_list);
+       tni = ieee80211_ref_node(ni);
+       TAILQ_INSERT_TAIL(&nt->nt_node, tni, ni_list);
+       tni = NULL;
+       
        LIST_INSERT_HEAD(&nt->nt_hash[IEEE80211_NODE_HASH(ni->ni_macaddr)], ni, ni_hash);
 }