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/ne.c | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/ne.c')
-rw-r--r-- | drivers/net/ne.c | 18 |
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) | |||
229 | err = do_ne_probe(dev); | 229 | err = do_ne_probe(dev); |
230 | if (err) | 230 | if (err) |
231 | goto out; | 231 | goto out; |
232 | err = register_netdev(dev); | ||
233 | if (err) | ||
234 | goto out1; | ||
235 | return dev; | 232 | return dev; |
236 | out1: | ||
237 | cleanup_card(dev); | ||
238 | out: | 233 | out: |
239 | free_netdev(dev); | 234 | free_netdev(dev); |
240 | return ERR_PTR(err); | 235 | return ERR_PTR(err); |
@@ -534,8 +529,14 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr) | |||
534 | dev->poll_controller = ei_poll; | 529 | dev->poll_controller = ei_poll; |
535 | #endif | 530 | #endif |
536 | NS8390_init(dev, 0); | 531 | NS8390_init(dev, 0); |
532 | |||
533 | ret = register_netdev(dev); | ||
534 | if (ret) | ||
535 | goto out_irq; | ||
537 | return 0; | 536 | return 0; |
538 | 537 | ||
538 | out_irq: | ||
539 | free_irq(dev->irq, dev); | ||
539 | err_out: | 540 | err_out: |
540 | release_region(ioaddr, NE_IO_EXTENT); | 541 | release_region(ioaddr, NE_IO_EXTENT); |
541 | return ret; | 542 | return ret; |
@@ -826,11 +827,8 @@ int init_module(void) | |||
826 | dev->mem_end = bad[this_dev]; | 827 | dev->mem_end = bad[this_dev]; |
827 | dev->base_addr = io[this_dev]; | 828 | dev->base_addr = io[this_dev]; |
828 | if (do_ne_probe(dev) == 0) { | 829 | if (do_ne_probe(dev) == 0) { |
829 | if (register_netdev(dev) == 0) { | 830 | dev_ne[found++] = dev; |
830 | dev_ne[found++] = dev; | 831 | continue; |
831 | continue; | ||
832 | } | ||
833 | cleanup_card(dev); | ||
834 | } | 832 | } |
835 | free_netdev(dev); | 833 | free_netdev(dev); |
836 | if (found) | 834 | if (found) |