4dc04711290562cae15ffe4c7201ffd2a9b2220b
[openwrt.git] / package / madwifi / patches / 331-memory_alloc.patch
1 Index: madwifi-trunk-r3314/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3314.orig/ath/if_ath.c 2008-02-20 18:10:52.499506168 +0100
4 +++ madwifi-trunk-r3314/ath/if_ath.c 2008-02-20 18:10:52.731519391 +0100
5 @@ -3315,17 +3315,18 @@
6 * without affecting any other bridge ports. */
7 if (skb_cloned(skb)) {
8 /* Remember the original SKB so we can free up our references */
9 - struct sk_buff *skb_orig = skb;
10 - skb = skb_copy(skb, GFP_ATOMIC);
11 - if (skb == NULL) {
12 + struct sk_buff *skb_new;
13 + skb_new = skb_copy(skb, GFP_ATOMIC);
14 + if (skb_new == NULL) {
15 DPRINTF(sc, ATH_DEBUG_XMIT,
16 "Dropping; skb_copy failure.\n");
17 /* No free RAM, do not requeue! */
18 goto hardstart_fail;
19 }
20 - ieee80211_skb_copy_noderef(skb_orig, skb);
21 - ieee80211_dev_kfree_skb(&skb_orig);
22 - }
23 + ieee80211_skb_copy_noderef(skb, skb_new);
24 + ieee80211_dev_kfree_skb(&skb);
25 + skb = skb_new;
26 + }
27 eh = (struct ether_header *)skb->data;
28
29 #ifdef ATH_SUPERG_FF
30 @@ -3591,11 +3592,13 @@
31 */
32 error = ath_tx_start(dev, SKB_CB(skb)->ni, bf, skb, 0);
33 if (error)
34 - goto bad;
35 + return error;
36
37 sc->sc_stats.ast_tx_mgmt++;
38 return 0;
39 bad:
40 + if (skb)
41 + ieee80211_dev_kfree_skb(&skb);
42 ath_return_txbuf(sc, &bf);
43 return error;
44 }
This page took 0.04311 seconds and 3 git commands to generate.