diff mbox series

[-next] wifi: mac80211: fix missing dev_kfree_skb() in error path in ieee80211_tx_control_port()

Message ID 20220818043349.4168835-1-yangyingliang@huawei.com
State New
Headers show
Series [-next] wifi: mac80211: fix missing dev_kfree_skb() in error path in ieee80211_tx_control_port() | expand

Commit Message

Yang Yingliang Aug. 18, 2022, 4:33 a.m. UTC
Add missing dev_kfree_skb() in error path in ieee80211_tx_control_port()
to avoid memory leak.

Fixes: dd820ed6336a ("wifi: mac80211: return error from control port TX for drops")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 net/mac80211/tx.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 45df9932d0ba..594bd70ee641 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -5885,6 +5885,7 @@  int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
 	rcu_read_lock();
 	err = ieee80211_lookup_ra_sta(sdata, skb, &sta);
 	if (err) {
+		dev_kfree_skb(skb);
 		rcu_read_unlock();
 		return err;
 	}