Skip to contentSkip to conversation

wifi: virt_wifi: free skb when disconnected

PATCH New Mariano Baragiola 1 participant 1 message Aug 9 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: virt_wifi: free skb when disconnected

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")
drivers/net/wireless/virtual/virt_wifi.c +1 -0
index 2335e45db8b8..b69a4650fba8 100644
@@ -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;
 	}
 
Signature · 1 line
2.55.0