vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
Subsystems (3)
PATCH 1/1 vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
__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.
--- net/vmw_vsock/af_vsock_tap.c | 4 ---- 1 file changed, 4 deletions(-)
net/vmw_vsock/af_vsock_tap.c +0 -4
@@ -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;
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
Quoted 36 lines · Eric Dumazet
__vsock_deliver_tap_skb()is called fromvsock_deliver_tap()underrcu_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)anddev_put(dev)calls.Signed-off-by Eric Dumazet <[email protected]>Cc Stefano Garzarella <[email protected]>--- net/vmw_vsock/af_vsock_tap.c | 4 ---- 1 file changed, 4 deletions(-)net/vmw_vsock/af_vsock_tap.c +0
-4@@ -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;Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
Quoted 6 lines · Eric Dumazet
__vsock_deliver_tap_skb()is called fromvsock_deliver_tap()underrcu_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.
Quoted 7 lines
Remove the redundant
dev_hold(dev)anddev_put(dev)calls.Signed-off-by Eric Dumazet <[email protected]>Cc Stefano Garzarella <[email protected]>---
net/vmw_vsock/af_vsock_tap.c| 4 ----1 file changed, 4 deletions(-)
LGTM!
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 9 lines · On Mon, 21 Sep 2026 09:42:18 +0000 you wrote:
__vsock_deliver_tap_skb()is called fromvsock_deliver_tap()underrcu_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)anddev_put(dev)calls.[...]
Here is the summary with links:
- [net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
https://git.kernel.org/netdev/net-next/c/6598456d72e4
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html