summaryrefslogtreecommitdiffstats
path: root/drivers/net/ne2.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/ne2.c
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
downloadop-kernel-dev-b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963.zip
op-kernel-dev-b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963.tar.gz
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/ne2.c')
-rw-r--r--drivers/net/ne2.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index 6ebef27..6d62ada 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -301,12 +301,7 @@ struct net_device * __init ne2_probe(int unit)
err = do_ne2_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);
@@ -517,7 +512,14 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
dev->poll_controller = ei_poll;
#endif
NS8390_init(dev, 0);
+
+ retval = register_netdev(dev);
+ if (retval)
+ goto out1;
return 0;
+out1:
+ mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
+ free_irq(dev->irq, dev);
out:
release_region(base_addr, NE_IO_EXTENT);
return retval;
@@ -798,11 +800,8 @@ int init_module(void)
dev->mem_end = bad[this_dev];
dev->base_addr = io[this_dev];
if (do_ne2_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
- dev_ne[found++] = dev;
- continue;
- }
- cleanup_card(dev);
+ dev_ne[found++] = dev;
+ continue;
}
free_netdev(dev);
break;
OpenPOWER on IntegriCloud