summaryrefslogtreecommitdiff
path: root/drivers/net/lance.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/lance.c
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
downloadlinux-3.10-b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963.tar.gz
linux-3.10-b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963.tar.bz2
linux-3.10-b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963.zip
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/lance.c')
-rw-r--r--drivers/net/lance.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index dec557fb6a9..ca90f0d1e4b 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -356,11 +356,8 @@ int init_module(void)
dev->base_addr = io[this_dev];
dev->dma = dma[this_dev];
if (do_lance_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
- dev_lance[found++] = dev;
- continue;
- }
- cleanup_card(dev);
+ dev_lance[found++] = dev;
+ continue;
}
free_netdev(dev);
break;
@@ -448,12 +445,7 @@ struct net_device * __init lance_probe(int unit)
err = do_lance_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);
@@ -724,6 +716,9 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
dev->tx_timeout = lance_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
+ err = register_netdev(dev);
+ if (err)
+ goto out_dma;
return 0;
out_dma:
if (dev->dma != 4)