Commit 385016f2 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[NET]: Make register_netdevice return correct error when driver init function fails.

parent f290bfd3
......@@ -2634,9 +2634,14 @@ int register_netdevice(struct net_device *dev)
dev->iflink = -1;
/* Init, if this function is available */
if (dev->init) {
ret = dev->init(dev);
if (ret) {
if (ret > 0)
ret = -EIO;
if (dev->init && dev->init(dev))
goto out_err;
}
}
dev->ifindex = dev_new_index();
if (dev->iflink == -1)
......
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