]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: devlink: remove net namespace check from devlink_nl_port_fill()
authorJiri Pirko <jiri@nvidia.com>
Wed, 2 Nov 2022 16:02:06 +0000 (17:02 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 4 Nov 2022 03:48:34 +0000 (20:48 -0700)
It is ensured by the netdevice notifier event processing, that only
netdev pointers from the same net namespaces are filled. Remove the
net namespace check from devlink_nl_port_fill() as it is no longer
needed.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/devlink.c

index 70a374c828ae91c37b7c08283acdb8277a8029b6..d948bb2fdd5f608e3d74a890123242f5af61165b 100644 (file)
@@ -1305,10 +1305,9 @@ static int devlink_nl_port_fill(struct sk_buff *msg,
                        devlink_port->desired_type))
                goto nla_put_failure_type_locked;
        if (devlink_port->type == DEVLINK_PORT_TYPE_ETH) {
-               struct net *net = devlink_net(devlink_port->devlink);
                struct net_device *netdev = devlink_port->type_eth.netdev;
 
-               if (netdev && net_eq(net, dev_net(netdev)) &&
+               if (netdev &&
                    (nla_put_u32(msg, DEVLINK_ATTR_PORT_NETDEV_IFINDEX,
                                 netdev->ifindex) ||
                     nla_put_string(msg, DEVLINK_ATTR_PORT_NETDEV_NAME,