From: Xiao Liang Date: Wed, 19 Feb 2025 12:50:31 +0000 (+0800) Subject: net: ip_tunnel: Don't set tunnel->net in ip_tunnel_init() X-Git-Tag: v6.15-rc1~160^2~252^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e17b2a1a097f3f3e8973722ccd3770eef193edd;p=thirdparty%2Fkernel%2Flinux.git net: ip_tunnel: Don't set tunnel->net in ip_tunnel_init() ip_tunnel_init() is called from register_netdevice(). In all code paths reaching here, tunnel->net should already have been set (either in ip_tunnel_newlink() or __ip_tunnel_create()). So don't set it again. Signed-off-by: Xiao Liang Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20250219125039.18024-6-shaw.leon@gmail.com Signed-off-by: Jakub Kicinski --- diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 09b73acf037ae..dd4b4e5be998a 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -1326,7 +1326,6 @@ int ip_tunnel_init(struct net_device *dev) } tunnel->dev = dev; - tunnel->net = dev_net(dev); strscpy(tunnel->parms.name, dev->name); iph->version = 4; iph->ihl = 5;