aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c523.c
diff options
context:
space:
mode:
author <herbert@gondor.apana.org.au>2005-05-12 20:11:55 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-12 20:11:55 -0400
commitb1fc5505e0dbcc3fd7c75bfe6bee39ec50080963 (patch)
treef8c0bb679dc8e72816e16820c3dbcccf924097eb /drivers/net/3c523.c
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/3c523.c')
-rw-r--r--drivers/net/3c523.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index 8f6b2fa13e28..1247a25f1093 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -572,6 +572,10 @@ static int __init do_elmc_probe(struct net_device *dev)
572 dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */ 572 dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */
573#endif 573#endif
574 574
575 retval = register_netdev(dev);
576 if (retval)
577 goto err_out;
578
575 return 0; 579 return 0;
576err_out: 580err_out:
577 mca_set_adapter_procfn(slot, NULL, NULL); 581 mca_set_adapter_procfn(slot, NULL, NULL);
@@ -600,12 +604,7 @@ struct net_device * __init elmc_probe(int unit)
600 err = do_elmc_probe(dev); 604 err = do_elmc_probe(dev);
601 if (err) 605 if (err)
602 goto out; 606 goto out;
603 err = register_netdev(dev);
604 if (err)
605 goto out1;
606 return dev; 607 return dev;
607out1:
608 cleanup_card(dev);
609out: 608out:
610 free_netdev(dev); 609 free_netdev(dev);
611 return ERR_PTR(err); 610 return ERR_PTR(err);
@@ -1288,12 +1287,9 @@ int init_module(void)
1288 dev->irq=irq[this_dev]; 1287 dev->irq=irq[this_dev];
1289 dev->base_addr=io[this_dev]; 1288 dev->base_addr=io[this_dev];
1290 if (do_elmc_probe(dev) == 0) { 1289 if (do_elmc_probe(dev) == 0) {
1291 if (register_netdev(dev) == 0) { 1290 dev_elmc[this_dev] = dev;
1292 dev_elmc[this_dev] = dev; 1291 found++;
1293 found++; 1292 continue;
1294 continue;
1295 }
1296 cleanup_card(dev);
1297 } 1293 }
1298 free_netdev(dev); 1294 free_netdev(dev);
1299 if (io[this_dev]==0) 1295 if (io[this_dev]==0)