Commit 6ac4a2a4 authored by Patrick Mochel's avatar Patrick Mochel

network devices: make sure kobjects always get unregistered.

Third time's a charm..

This moves the kobject_unregister() call to after the out: label, making 
sure it always gets unregistered. It wasn't if

	if (dev->features & NETIF_F_DYNALLOC)

was true (which it is for PPP devices), causing re-registration of devices
to fail. 
parent 5ec7805b
......@@ -2678,8 +2678,6 @@ int unregister_netdevice(struct net_device *dev)
goto out;
}
kobject_unregister(&dev->kobj);
/* Last reference is our one */
if (atomic_read(&dev->refcnt) == 1)
goto out;
......@@ -2740,6 +2738,7 @@ int unregister_netdevice(struct net_device *dev)
}
}
out:
kobject_unregister(&dev->kobj);
dev_put(dev);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment