refresh a patch that is causing problems on certain systems
[openwrt/svn-archive/archive.git] / package / madwifi / patches / 124-node_unref_r2484.patch
1 Index: madwifi-ng-r2420-20070602/ath/if_ath.c
2 ===================================================================
3 --- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-07-02 23:49:33.450710750 +0200
4 +++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-07-02 23:50:43.107064000 +0200
5 @@ -8197,16 +8197,15 @@
6 wds_ni->ni_rates = vap->iv_bss->ni_rates;
7 /* Depending on the sequence of bringing up devices
8 * it's possible the rates of the root bss isn't
9 - * filled yet.
10 - */
11 - if (vap->iv_ic->ic_newassoc != NULL &&
12 - wds_ni->ni_rates.rs_nrates != 0) {
13 + * filled yet. */
14 + if ((vap->iv_ic->ic_newassoc != NULL) &&
15 + (wds_ni->ni_rates.rs_nrates != 0)) {
16 /* Fill in the rates based on our own rates
17 * we rely on the rate selection mechanism
18 - * to find out which rates actually work!
19 - */
20 + * to find out which rates actually work! */
21 vap->iv_ic->ic_newassoc(wds_ni, 1);
22 }
23 + ieee80211_unref_node(&wds_ni);
24 }
25 break;
26 default:
27 Index: madwifi-ng-r2420-20070602/net80211/ieee80211_output.c
28 ===================================================================
29 --- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_output.c 2007-07-02 23:49:31.574593500 +0200
30 +++ madwifi-ng-r2420-20070602/net80211/ieee80211_output.c 2007-07-02 23:50:37.462711250 +0200
31 @@ -268,6 +268,7 @@
32 * We'll get the frame back when the time is right.
33 */
34 ieee80211_pwrsave(ni, skb);
35 + ieee80211_unref_node(&ni);
36 return 0;
37 }
38
39 @@ -282,7 +283,7 @@
40 vap->iv_xrvap->iv_sta_assoc) {
41 struct sk_buff *skb1;
42 ni = ieee80211_find_txnode(vap->iv_xrvap, eh->ether_dhost);
43 - skb1 = skb_clone(skb,GFP_ATOMIC);
44 + skb1 = skb_clone(skb, GFP_ATOMIC);
45 if (skb1) {
46 cb = (struct ieee80211_cb *) skb1->cb;
47 cb->ni = ni;
48 Index: madwifi-ng-r2420-20070602/net80211/ieee80211_wireless.c
49 ===================================================================
50 --- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_wireless.c 2007-07-02 23:49:31.566593000 +0200
51 +++ madwifi-ng-r2420-20070602/net80211/ieee80211_wireless.c 2007-07-02 23:49:34.126753000 +0200
52 @@ -1088,7 +1088,6 @@
53 /* locate a node, read its rssi, check if updated, convert to dBm */
54 for (i = 0; i < number; i++) {
55 ni = ieee80211_find_node(nt, &vap->iv_spy.mac[i * IEEE80211_ADDR_LEN]);
56 - /* TODO: free node ? */
57 /* check we are associated w/ this vap */
58 if (ni && (ni->ni_vap == vap)) {
59 set_quality(&spy_stat[i], ni->ni_rssi, ic->ic_channoise);
60 @@ -1100,6 +1099,7 @@
61 } else {
62 spy_stat[i].updated = IW_QUAL_ALL_INVALID;
63 }
64 + ieee80211_unref_node(&ni);
65 }
66
67 /* copy results to userspace */
68 @@ -3153,6 +3153,7 @@
69 /* NB: this also checks ik->ik_keylen > sizeof(wk->wk_key) */
70 if (ik->ik_keylen > sizeof(ik->ik_keydata))
71 return -E2BIG;
72 +
73 kix = ik->ik_keyix;
74 if (kix == IEEE80211_KEYIX_NONE) {
75 /* XXX unicast keys currently must be tx/rx */
76 @@ -3176,6 +3177,7 @@
77 if ((ik->ik_flags & IEEE80211_KEY_XMIT) == 0) /* XXX */
78 ik->ik_flags |= IEEE80211_KEY_GROUP; /* XXX */
79 }
80 +
81 error = 0;
82 flags = ik->ik_flags & IEEE80211_KEY_COMMON;
83 ieee80211_key_update_begin(vap);
84 @@ -3190,12 +3192,13 @@
85 memset(wk->wk_key, 0, sizeof(wk->wk_key));
86 memcpy(wk->wk_key, ik->ik_keydata, ik->ik_keylen);
87 if (!ieee80211_crypto_setkey(vap, wk,
88 - ni != NULL ? ni->ni_macaddr : ik->ik_macaddr, ni))
89 + (ni != NULL) ? ni->ni_macaddr : ik->ik_macaddr, ni))
90 error = -EIO;
91 else if ((ik->ik_flags & IEEE80211_KEY_DEFAULT))
92 vap->iv_def_txkey = kix;
93 } else
94 error = -ENXIO;
95 +
96 ieee80211_key_update_end(vap);
97 if (ni != NULL)
98 ieee80211_unref_node(&ni);