]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ieee802154: ca8210: Stop leaking skb's
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 25 Jan 2022 12:14:24 +0000 (13:14 +0100)
committerStefan Schmidt <stefan@datenfreihafen.org>
Thu, 27 Jan 2022 07:20:39 +0000 (08:20 +0100)
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>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20220125121426.848337-5-miquel.raynal@bootlin.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
drivers/net/ieee802154/ca8210.c

index ece6ff6049f66b9d9ffaec53b696adb0235e836c..f3438d3e104acb77cd4183cab3b8fc87901b76d9 100644 (file)
@@ -1771,6 +1771,7 @@ static int ca8210_async_xmit_complete(
                        status
                );
                if (status != MAC_TRANSACTION_OVERFLOW) {
+                       dev_kfree_skb_any(priv->tx_skb);
                        ieee802154_wake_queue(priv->hw);
                        return 0;
                }