Skip to content

Commit

Permalink
[RTNL]: Relax for_each_netdev_safe in __rtnl_link_unregister.
Browse files Browse the repository at this point in the history
Each potential list_del (happening from inside a ->dellink call)
is followed by goto restart, so there's no need in _safe iteration.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Apr 16, 2008
1 parent fc54c65 commit 3a931a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ EXPORT_SYMBOL_GPL(rtnl_link_register);
*/
void __rtnl_link_unregister(struct rtnl_link_ops *ops)
{
struct net_device *dev, *n;
struct net_device *dev;
struct net *net;

for_each_net(net) {
restart:
for_each_netdev_safe(net, dev, n) {
for_each_netdev(net, dev) {
if (dev->rtnl_link_ops == ops) {
ops->dellink(dev);
goto restart;
Expand Down

0 comments on commit 3a931a8

Please sign in to comment.