Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
@ 2026-09-21  9:42 Eric Dumazet
  2026-09-21 17:32 ` Bobby Eshleman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Dumazet @ 2026-09-21  9:42 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Kuniyuki Iwashima, netdev, eric.dumazet,
	Eric Dumazet, Stefano Garzarella

__vsock_deliver_tap_skb() is called from vsock_deliver_tap()
under rcu_read_lock().

dev_queue_xmit() does not require the caller to hold a device reference
count, and the device lifetime is already protected by RCU.

Remove the redundant dev_hold(dev) and dev_put(dev) calls.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
---
 net/vmw_vsock/af_vsock_tap.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/vmw_vsock/af_vsock_tap.c b/net/vmw_vsock/af_vsock_tap.c
index 30ee7e4fe25115cef71b43f335862a09b8c51382..7c5cdceabb2a5f7079faab243ee9de7d6bb8857c 100644
--- a/net/vmw_vsock/af_vsock_tap.c
+++ b/net/vmw_vsock/af_vsock_tap.c
@@ -64,14 +64,10 @@ static int __vsock_deliver_tap_skb(struct sk_buff *skb,
 	struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
 
 	if (nskb) {
-		dev_hold(dev);
-
 		nskb->dev = dev;
 		ret = dev_queue_xmit(nskb);
 		if (unlikely(ret > 0))
 			ret = net_xmit_errno(ret);
-
-		dev_put(dev);
 	}
 
 	return ret;
-- 
2.55.0.1082.g2b9226bbc0-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-22 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21  9:42 [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb() Eric Dumazet
2026-09-21 17:32 ` Bobby Eshleman
2026-09-22 10:45 ` Stefano Garzarella
2026-09-22 13:20 ` patchwork-bot+netdevbpf

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