Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: virt_wifi: free skb when disconnected
@ 2026-08-09 12:49 Mariano Baragiola
  0 siblings, 0 replies; only message in thread
From: Mariano Baragiola @ 2026-08-09 12:49 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Mariano Baragiola

When the simulated link is disconnected, virt_wifi_start_xmit() returns
NET_XMIT_DROP without freeing the skb. dev_hard_start_xmit() treats this
return value as consumed, so every packet sent while disconnected leaks its
skb.

Free the skb before returning the drop status.

Fixes: c7cdba31ed8b ("mac80211-next: rtnetlink wifi simulation device")
Signed-off-by: Mariano Baragiola <mbaragiola@linux.com>

diff --git a/drivers/net/wireless/virtual/virt_wifi.c b/drivers/net/wireless/virtual/virt_wifi.c
index 2335e45db8b8..b69a4650fba8 100644
--- a/drivers/net/wireless/virtual/virt_wifi.c
+++ b/drivers/net/wireless/virtual/virt_wifi.c
@@ -434,6 +434,7 @@ static netdev_tx_t virt_wifi_start_xmit(struct sk_buff *skb,
 	priv->tx_packets++;
 	if (!priv->is_connected) {
 		priv->tx_failed++;
+		dev_kfree_skb_any(skb);
 		return NET_XMIT_DROP;
 	}
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-09 12:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-09 12:49 [PATCH] wifi: virt_wifi: free skb when disconnected Mariano Baragiola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox