[netdrvr] Fix register_netdev() races in older ISA net drivers
This commit is contained in:
@@ -167,12 +167,7 @@ struct net_device * __init lne390_probe(int unit)
|
||||
err = do_lne390_probe(dev);
|
||||
if (err)
|
||||
goto out;
|
||||
err = register_netdev(dev);
|
||||
if (err)
|
||||
goto out1;
|
||||
return dev;
|
||||
out1:
|
||||
cleanup_card(dev);
|
||||
out:
|
||||
free_netdev(dev);
|
||||
return ERR_PTR(err);
|
||||
@@ -296,7 +291,14 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
|
||||
dev->poll_controller = ei_poll;
|
||||
#endif
|
||||
NS8390_init(dev, 0);
|
||||
|
||||
ret = register_netdev(dev);
|
||||
if (ret)
|
||||
goto unmap;
|
||||
return 0;
|
||||
unmap:
|
||||
if (ei_status.reg0)
|
||||
iounmap((void *)dev->mem_start);
|
||||
cleanup:
|
||||
free_irq(dev->irq, dev);
|
||||
return ret;
|
||||
@@ -426,11 +428,8 @@ int init_module(void)
|
||||
dev->base_addr = io[this_dev];
|
||||
dev->mem_start = mem[this_dev];
|
||||
if (do_lne390_probe(dev) == 0) {
|
||||
if (register_netdev(dev) == 0) {
|
||||
dev_lne[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
cleanup_card(dev);
|
||||
dev_lne[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
free_netdev(dev);
|
||||
printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]);
|
||||
|
Reference in New Issue
Block a user