summaryrefslogtreecommitdiff
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 8f6b2fa13e2..1247a25f109 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)
dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */
#endif
+ retval = register_netdev(dev);
+ if (retval)
+ goto err_out;
+
return 0;
err_out:
mca_set_adapter_procfn(slot, NULL, NULL);
@@ -600,12 +604,7 @@ struct net_device * __init elmc_probe(int unit)
err = do_elmc_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);
@@ -1288,12 +1287,9 @@ int init_module(void)
dev->irq=irq[this_dev];
dev->base_addr=io[this_dev];
if (do_elmc_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
- dev_elmc[this_dev] = dev;
- found++;
- continue;
- }
- cleanup_card(dev);
+ dev_elmc[this_dev] = dev;
+ found++;
+ continue;
}
free_netdev(dev);
if (io[this_dev]==0)