]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bareudp: Remove synchronize_net() in bareudp_sock_release().
authorKuniyuki Iwashima <kuniyu@google.com>
Mon, 18 May 2026 05:07:11 +0000 (05:07 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 May 2026 02:12:29 +0000 (19:12 -0700)
synchronize_net() in bareudp_sock_release() has existed since
day 1, commit 571912c69f0e ("net: UDP tunnel encapsulation module
for tunnelling different protocols like MPLS, IP, NSH etc.").

It was most likely copied from a similar tunneling device like
vxlan or geneve.

bareudp_sock_release() is called from dev->netdev_ops->ndo_stop(),
and synchronize_net() in unregister_netdevice_many_notify() ensures
that inflight bareudp fast paths finish before bareudp_dev is freed.

Let's remove the redundant synchronize_net() in bareudp_sock_release().

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260518050726.318824-5-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bareudp.c

index 890a0650d9cf170f306e86622a1d2f6bac50b81c..bfcecdcffe670fbc8e4e601f0940f6cb777c89cd 100644 (file)
@@ -287,7 +287,6 @@ static void bareudp_sock_release(struct bareudp_dev *bareudp)
 
        sk = bareudp->sk;
        rcu_assign_pointer(bareudp->sk, NULL);
-       synchronize_net();
        udp_tunnel_sock_release(sk);
 }