summaryrefslogtreecommitdiffstats
path: root/drivers/net/ne.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/ne.c
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
downloadblackbird-op-linux-b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963.tar.gz
blackbird-op-linux-b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963.zip
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/ne.c')
-rw-r--r--drivers/net/ne.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 496433902ade..6c57096aa2e1 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -229,12 +229,7 @@ struct net_device * __init ne_probe(int unit)
err = do_ne_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);
@@ -534,8 +529,14 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
dev->poll_controller = ei_poll;
#endif
NS8390_init(dev, 0);
+
+ ret = register_netdev(dev);
+ if (ret)
+ goto out_irq;
return 0;
+out_irq:
+ free_irq(dev->irq, dev);
err_out:
release_region(ioaddr, NE_IO_EXTENT);
return ret;
@@ -826,11 +827,8 @@ int init_module(void)
dev->mem_end = bad[this_dev];
dev->base_addr = io[this_dev];
if (do_ne_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
- dev_ne[found++] = dev;
- continue;
- }
- cleanup_card(dev);
+ dev_ne[found++] = dev;
+ continue;
}
free_netdev(dev);
if (found)
OpenPOWER on IntegriCloud