[netdrvr] Fix register_netdev() races in older ISA net drivers
This commit is contained in:
@ -162,12 +162,7 @@ struct net_device * __init e2100_probe(int unit)
|
||||
err = do_e2100_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);
|
||||
@ -286,6 +281,9 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)
|
||||
#endif
|
||||
NS8390_init(dev, 0);
|
||||
|
||||
retval = register_netdev(dev);
|
||||
if (retval)
|
||||
goto out;
|
||||
return 0;
|
||||
out:
|
||||
release_region(ioaddr, E21_IO_EXTENT);
|
||||
@ -453,11 +451,8 @@ init_module(void)
|
||||
dev->mem_start = mem[this_dev];
|
||||
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
|
||||
if (do_e2100_probe(dev) == 0) {
|
||||
if (register_netdev(dev) == 0) {
|
||||
dev_e21[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
cleanup_card(dev);
|
||||
dev_e21[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
free_netdev(dev);
|
||||
printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]);
|
||||
|
Reference in New Issue
Block a user