diff mbox series

[wpan-next,5/9] net: ieee802154: ca8210: Stop leaking skb's

Message ID 20220120003645.308498-6-miquel.raynal@bootlin.com
State New
Headers show
Series ieee802154: A bunch of fixes | expand

Commit Message

Miquel Raynal Jan. 20, 2022, 12:36 a.m. UTC
Upon error the ieee802154_xmit_complete() helper is not called. Only
ieee802154_wake_queue() is called manually. We then leak the skb
structure.

Free the skb structure upon error before returning.

Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/net/ieee802154/ca8210.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index ece6ff6049f6..5d1b356cb9d3 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -1772,6 +1772,7 @@  static int ca8210_async_xmit_complete(
 		);
 		if (status != MAC_TRANSACTION_OVERFLOW) {
 			ieee802154_wake_queue(priv->hw);
+			dev_kfree_skb_any(atusb->tx_skb);
 			return 0;
 		}
 	}