aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/dev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index c36a17aafcf3..6fe7d739e59b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4771,21 +4771,23 @@ static void net_set_todo(struct net_device *dev)
4771 4771
4772static void rollback_registered_many(struct list_head *head) 4772static void rollback_registered_many(struct list_head *head)
4773{ 4773{
4774 struct net_device *dev; 4774 struct net_device *dev, *tmp;
4775 4775
4776 BUG_ON(dev_boot_phase); 4776 BUG_ON(dev_boot_phase);
4777 ASSERT_RTNL(); 4777 ASSERT_RTNL();
4778 4778
4779 list_for_each_entry(dev, head, unreg_list) { 4779 list_for_each_entry_safe(dev, tmp, head, unreg_list) {
4780 /* Some devices call without registering 4780 /* Some devices call without registering
4781 * for initialization unwind. 4781 * for initialization unwind. Remove those
4782 * devices and proceed with the remaining.
4782 */ 4783 */
4783 if (dev->reg_state == NETREG_UNINITIALIZED) { 4784 if (dev->reg_state == NETREG_UNINITIALIZED) {
4784 pr_debug("unregister_netdevice: device %s/%p never " 4785 pr_debug("unregister_netdevice: device %s/%p never "
4785 "was registered\n", dev->name, dev); 4786 "was registered\n", dev->name, dev);
4786 4787
4787 WARN_ON(1); 4788 WARN_ON(1);
4788 return; 4789 list_del(&dev->unreg_list);
4790 continue;
4789 } 4791 }
4790 4792
4791 BUG_ON(dev->reg_state != NETREG_REGISTERED); 4793 BUG_ON(dev->reg_state != NETREG_REGISTERED);