351-0051-brcmfmac-use-correct-skb-freeing-helper-when-deletin.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 7f00ee2bbc630900ba16fc2690473f3e2db0e264 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Tue, 27 Sep 2016 14:11:04 +0200
  4. Subject: [PATCH] brcmfmac: use correct skb freeing helper when deleting
  5. flowring
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Flowrings contain skbs waiting for transmission that were passed to us
  10. by netif. It means we checked every one of them looking for 802.1x
  11. Ethernet type. When deleting flowring we have to use freeing function
  12. that will check for 802.1x type as well.
  13. Freeing skbs without a proper check was leading to counter not being
  14. properly decreased. This was triggering a WARNING every time
  15. brcmf_netdev_wait_pend8021x was called.
  16. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  17. Acked-by: Arend van Spriel <arend@broadcom.com>
  18. Cc: stable@vger.kernel.org # 4.5+
  19. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  20. ---
  21. drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 9 ++++++++-
  22. 1 file changed, 8 insertions(+), 1 deletion(-)
  23. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
  24. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c
  25. @@ -234,13 +234,20 @@ static void brcmf_flowring_block(struct
  26. void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid)
  27. {
  28. + struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev);
  29. struct brcmf_flowring_ring *ring;
  30. + struct brcmf_if *ifp;
  31. u16 hash_idx;
  32. + u8 ifidx;
  33. struct sk_buff *skb;
  34. ring = flow->rings[flowid];
  35. if (!ring)
  36. return;
  37. +
  38. + ifidx = brcmf_flowring_ifidx_get(flow, flowid);
  39. + ifp = brcmf_get_ifp(bus_if->drvr, ifidx);
  40. +
  41. brcmf_flowring_block(flow, flowid, false);
  42. hash_idx = ring->hash_id;
  43. flow->hash[hash_idx].ifidx = BRCMF_FLOWRING_INVALID_IFIDX;
  44. @@ -249,7 +256,7 @@ void brcmf_flowring_delete(struct brcmf_
  45. skb = skb_dequeue(&ring->skblist);
  46. while (skb) {
  47. - brcmu_pkt_buf_free_skb(skb);
  48. + brcmf_txfinalize(ifp, skb, false);
  49. skb = skb_dequeue(&ring->skblist);
  50. }