>From 0fb563b521939707808b720d3e5801b3370c97f2 Mon Sep 17 00:00:00 2001 From: Lee Keon-Hyeong Date: Fri, 27 Nov 2026 11:42:37 +0900 Subject: [PATCH net v2 1/2] mac802154: free the skb when MLME TX is rejected ieee802154_mlme_tx_locked() returns -ENETDOWN on two paths before passing the skb to ieee802154_tx(). Its callers expect it to consume the skb, so both paths leak it. Free the skb before returning. I found this during an LLM-assisted review of the MLME TX error paths. An earlier review of beacon TX also noted the leak. The association tests exercised only successful transmissions. I did not test either error path or run the in-tree selftests. Link: https://lore.kernel.org/linux-wpan/179370015236.488856.9062135405491525675@kernel.org/ Fixes: ddd9ee7cda12 ("net: mac802154: Introduce a synchronous API for MLME commands") Fixes: 4f790184139b ("net: mac802154: Add a warning in the slow path") Signed-off-by: Lee Keon-Hyeong --- net/mac802154/tx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c index 4d13f18f6..af5003b93 100644 --- a/net/mac802154/tx.c +++ b/net/mac802154/tx.c @@ -147,14 +147,18 @@ int ieee802154_mlme_tx_locked(struct ieee802154_local *local, ASSERT_RTNL(); /* Ensure the device was not stopped, otherwise error out */ - if (!local->open_count) + if (!local->open_count) { + kfree_skb(skb); return -ENETDOWN; + } /* Warn if the ieee802154 core thinks MLME frames can be sent while the * net interface expects this cannot happen. */ - if (WARN_ON_ONCE(!netif_running(sdata->dev))) + if (WARN_ON_ONCE(!netif_running(sdata->dev))) { + kfree_skb(skb); return -ENETDOWN; + } ieee802154_tx(local, skb); return ieee802154_sync_queue(local); -- 2.56.0