aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/patches/124-node_unref_r2484.patch
blob: ea0b917f974e3472a7ff7763f1aa94e52eb5252f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Index: madwifi/net80211/ieee80211_wireless.c
===================================================================
--- madwifi/net80211/ieee80211_wireless.c (revision 2482)
+++ madwifi/net80211/ieee80211_wireless.c (revision 2484)
@@ -1102,5 +1102,4 @@
 	for (i = 0; i < number; i++) {
 		ni = ieee80211_find_node(nt, &vap->iv_spy.mac[i * IEEE80211_ADDR_LEN]);
-		/* TODO: free node ? */
 		/* check we are associated w/ this vap */
 		if (ni && (ni->ni_vap == vap)) {
@@ -1114,4 +1113,5 @@
 			spy_stat[i].updated = IW_QUAL_ALL_INVALID;
 		}
+		ieee80211_unref_node(&ni);
 	}
 
@@ -3191,4 +3191,5 @@
 	if (ik->ik_keylen > sizeof(ik->ik_keydata))
 		return -E2BIG;
+
 	kix = ik->ik_keyix;
 	if (kix == IEEE80211_KEYIX_NONE) {
@@ -3214,4 +3215,5 @@
 			ik->ik_flags |= IEEE80211_KEY_GROUP;	/* XXX */
 	}
+
 	error = 0;
 	flags = ik->ik_flags & IEEE80211_KEY_COMMON;
@@ -3228,5 +3230,5 @@
 		memcpy(wk->wk_key, ik->ik_keydata, ik->ik_keylen);
 		if (!ieee80211_crypto_setkey(vap, wk,
-		    ni != NULL ? ni->ni_macaddr : ik->ik_macaddr, ni))
+		    (ni != NULL) ? ni->ni_macaddr : ik->ik_macaddr, ni))
 			error = -EIO;
 		else if ((ik->ik_flags & IEEE80211_KEY_DEFAULT))
@@ -3234,4 +3236,5 @@
 	} else
 		error = -ENXIO;
+
 	ieee80211_key_update_end(vap);
 	if (ni != NULL)
Index: madwifi/net80211/ieee80211_output.c
===================================================================
--- madwifi/net80211/ieee80211_output.c (revision 2438)
+++ madwifi/net80211/ieee80211_output.c (revision 2484)
@@ -269,4 +269,5 @@
 		 */
 		ieee80211_pwrsave(ni, skb);
+		ieee80211_unref_node(&ni);
 		return 0;
 	}
@@ -283,5 +284,5 @@
 		struct sk_buff *skb1;
 		ni = ieee80211_find_txnode(vap->iv_xrvap, eh->ether_dhost);
-		skb1 = skb_clone(skb,GFP_ATOMIC);
+		skb1 = skb_clone(skb, GFP_ATOMIC);
 		if (skb1) {
 			cb = (struct ieee80211_cb *) skb1->cb;
Index: madwifi/ath/if_ath.c
===================================================================
--- madwifi/ath/if_ath.c (revision 2482)
+++ madwifi/ath/if_ath.c (revision 2484)
@@ -8111,14 +8111,13 @@
 				/* Depending on the sequence of bringing up devices
 				 * it's possible the rates of the root bss isn't
-				 * filled yet. 
-				 */
-				if (vap->iv_ic->ic_newassoc != NULL &&
-				    wds_ni->ni_rates.rs_nrates != 0) {
+				 * filled yet. */
+				if ((vap->iv_ic->ic_newassoc != NULL) &&
+				    (wds_ni->ni_rates.rs_nrates != 0)) {
 					/* Fill in the rates based on our own rates
 					 * we rely on the rate selection mechanism
-					 * to find out which rates actually work!
-					 */
+					 * to find out which rates actually work! */
 					vap->iv_ic->ic_newassoc(wds_ni, 1);
 				}
+				ieee80211_unref_node(&wds_ni);
 			}
 			break;