diff options
author | <herbert@gondor.apana.org.au> | 2005-05-12 20:11:55 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-12 20:11:55 -0400 |
commit | b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963 (patch) | |
tree | f8c0bb679dc8e72816e16820c3dbcccf924097eb /drivers/net/ne2.c | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/ne2.c')
-rw-r--r-- | drivers/net/ne2.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c index 6ebef27dbfae..6d62ada85de6 100644 --- a/drivers/net/ne2.c +++ b/drivers/net/ne2.c | |||
@@ -301,12 +301,7 @@ struct net_device * __init ne2_probe(int unit) | |||
301 | err = do_ne2_probe(dev); | 301 | err = do_ne2_probe(dev); |
302 | if (err) | 302 | if (err) |
303 | goto out; | 303 | goto out; |
304 | err = register_netdev(dev); | ||
305 | if (err) | ||
306 | goto out1; | ||
307 | return dev; | 304 | return dev; |
308 | out1: | ||
309 | cleanup_card(dev); | ||
310 | out: | 305 | out: |
311 | free_netdev(dev); | 306 | free_netdev(dev); |
312 | return ERR_PTR(err); | 307 | return ERR_PTR(err); |
@@ -517,7 +512,14 @@ static int __init ne2_probe1(struct net_device *dev, int slot) | |||
517 | dev->poll_controller = ei_poll; | 512 | dev->poll_controller = ei_poll; |
518 | #endif | 513 | #endif |
519 | NS8390_init(dev, 0); | 514 | NS8390_init(dev, 0); |
515 | |||
516 | retval = register_netdev(dev); | ||
517 | if (retval) | ||
518 | goto out1; | ||
520 | return 0; | 519 | return 0; |
520 | out1: | ||
521 | mca_set_adapter_procfn( ei_status.priv, NULL, NULL); | ||
522 | free_irq(dev->irq, dev); | ||
521 | out: | 523 | out: |
522 | release_region(base_addr, NE_IO_EXTENT); | 524 | release_region(base_addr, NE_IO_EXTENT); |
523 | return retval; | 525 | return retval; |
@@ -798,11 +800,8 @@ int init_module(void) | |||
798 | dev->mem_end = bad[this_dev]; | 800 | dev->mem_end = bad[this_dev]; |
799 | dev->base_addr = io[this_dev]; | 801 | dev->base_addr = io[this_dev]; |
800 | if (do_ne2_probe(dev) == 0) { | 802 | if (do_ne2_probe(dev) == 0) { |
801 | if (register_netdev(dev) == 0) { | 803 | dev_ne[found++] = dev; |
802 | dev_ne[found++] = dev; | 804 | continue; |
803 | continue; | ||
804 | } | ||
805 | cleanup_card(dev); | ||
806 | } | 805 | } |
807 | free_netdev(dev); | 806 | free_netdev(dev); |
808 | break; | 807 | break; |