diff options
author | Jiri Pirko <jiri@mellanox.com> | 2020-01-25 12:17:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-27 11:03:44 +0100 |
commit | 48b3a1379fc6603c1ff26893ea05322c1c41e31c (patch) | |
tree | bb17a8266ab68eee1da8298883fd353de60ba1e7 /net | |
parent | cd94ef06392ffd49e0a0e1c28bc5cd44f37f1f6b (diff) | |
download | linux-48b3a1379fc6603c1ff26893ea05322c1c41e31c.tar.bz2 |
net: call call_netdevice_unregister_net_notifiers from unregister
The function does the same thing as the existing code, so rather call
call_netdevice_unregister_net_notifiers() instead of code duplication.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index ce8900dbd9ea..ee4b1e64d663 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1764,7 +1764,6 @@ EXPORT_SYMBOL(register_netdevice_notifier); int unregister_netdevice_notifier(struct notifier_block *nb) { - struct net_device *dev; struct net *net; int err; @@ -1775,16 +1774,9 @@ int unregister_netdevice_notifier(struct notifier_block *nb) if (err) goto unlock; - for_each_net(net) { - for_each_netdev(net, dev) { - if (dev->flags & IFF_UP) { - call_netdevice_notifier(nb, NETDEV_GOING_DOWN, - dev); - call_netdevice_notifier(nb, NETDEV_DOWN, dev); - } - call_netdevice_notifier(nb, NETDEV_UNREGISTER, dev); - } - } + for_each_net(net) + call_netdevice_unregister_net_notifiers(nb, net); + unlock: rtnl_unlock(); up_write(&pernet_ops_rwsem); |