]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/rtnetlink.c
[NET]: rtnl_link: fix use-after-free
[linux-2.6-omap-h63xx.git] / net / core / rtnetlink.c
index e1ba26fb4bf28052fd0150f08ed5d6eaa057fa19..fed95a323b281049f8245ba2fc1619c21decf2c9 100644 (file)
@@ -308,9 +308,12 @@ void __rtnl_link_unregister(struct rtnl_link_ops *ops)
        struct net *net;
 
        for_each_net(net) {
+restart:
                for_each_netdev_safe(net, dev, n) {
-                       if (dev->rtnl_link_ops == ops)
+                       if (dev->rtnl_link_ops == ops) {
                                ops->dellink(dev);
+                               goto restart;
+                       }
                }
        }
        list_del(&ops->list);