331-memory_alloc.patch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --- a/ath/if_ath.c
  2. +++ b/ath/if_ath.c
  3. @@ -3320,17 +3320,18 @@ ath_hardstart(struct sk_buff *skb, struc
  4. * without affecting any other bridge ports. */
  5. if (skb_cloned(skb)) {
  6. /* Remember the original SKB so we can free up our references */
  7. - struct sk_buff *skb_orig = skb;
  8. - skb = skb_copy(skb, GFP_ATOMIC);
  9. - if (skb == NULL) {
  10. + struct sk_buff *skb_new;
  11. + skb_new = skb_copy(skb, GFP_ATOMIC);
  12. + if (skb_new == NULL) {
  13. DPRINTF(sc, ATH_DEBUG_XMIT,
  14. "Dropping; skb_copy failure.\n");
  15. /* No free RAM, do not requeue! */
  16. goto hardstart_fail;
  17. }
  18. - ieee80211_skb_copy_noderef(skb_orig, skb);
  19. - ieee80211_dev_kfree_skb(&skb_orig);
  20. - }
  21. + ieee80211_skb_copy_noderef(skb, skb_new);
  22. + ieee80211_dev_kfree_skb(&skb);
  23. + skb = skb_new;
  24. + }
  25. eh = (struct ether_header *)skb->data;
  26. #ifdef ATH_SUPERG_FF
  27. @@ -3601,6 +3602,8 @@ ath_mgtstart(struct ieee80211com *ic, st
  28. sc->sc_stats.ast_tx_mgmt++;
  29. return 0;
  30. bad:
  31. + if (skb)
  32. + ieee80211_dev_kfree_skb(&skb);
  33. ath_return_txbuf(sc, &bf);
  34. return error;
  35. }