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/eth16i.c | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/eth16i.c')
-rw-r--r-- | drivers/net/eth16i.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c index ccae6ba5f7c5..f32a6b3acb2a 100644 --- a/drivers/net/eth16i.c +++ b/drivers/net/eth16i.c | |||
@@ -473,13 +473,7 @@ struct net_device * __init eth16i_probe(int unit) | |||
473 | err = do_eth16i_probe(dev); | 473 | err = do_eth16i_probe(dev); |
474 | if (err) | 474 | if (err) |
475 | goto out; | 475 | goto out; |
476 | err = register_netdev(dev); | ||
477 | if (err) | ||
478 | goto out1; | ||
479 | return dev; | 476 | return dev; |
480 | out1: | ||
481 | free_irq(dev->irq, dev); | ||
482 | release_region(dev->base_addr, ETH16I_IO_EXTENT); | ||
483 | out: | 477 | out: |
484 | free_netdev(dev); | 478 | free_netdev(dev); |
485 | return ERR_PTR(err); | 479 | return ERR_PTR(err); |
@@ -569,7 +563,13 @@ static int __init eth16i_probe1(struct net_device *dev, int ioaddr) | |||
569 | dev->tx_timeout = eth16i_timeout; | 563 | dev->tx_timeout = eth16i_timeout; |
570 | dev->watchdog_timeo = TX_TIMEOUT; | 564 | dev->watchdog_timeo = TX_TIMEOUT; |
571 | spin_lock_init(&lp->lock); | 565 | spin_lock_init(&lp->lock); |
566 | |||
567 | retval = register_netdev(dev); | ||
568 | if (retval) | ||
569 | goto out1; | ||
572 | return 0; | 570 | return 0; |
571 | out1: | ||
572 | free_irq(dev->irq, dev); | ||
573 | out: | 573 | out: |
574 | release_region(ioaddr, ETH16I_IO_EXTENT); | 574 | release_region(ioaddr, ETH16I_IO_EXTENT); |
575 | return retval; | 575 | return retval; |
@@ -1462,12 +1462,8 @@ int init_module(void) | |||
1462 | } | 1462 | } |
1463 | 1463 | ||
1464 | if (do_eth16i_probe(dev) == 0) { | 1464 | if (do_eth16i_probe(dev) == 0) { |
1465 | if (register_netdev(dev) == 0) { | 1465 | dev_eth16i[found++] = dev; |
1466 | dev_eth16i[found++] = dev; | 1466 | continue; |
1467 | continue; | ||
1468 | } | ||
1469 | free_irq(dev->irq, dev); | ||
1470 | release_region(dev->base_addr, ETH16I_IO_EXTENT); | ||
1471 | } | 1467 | } |
1472 | printk(KERN_WARNING "eth16i.c No Eth16i card found (i/o = 0x%x).\n", | 1468 | printk(KERN_WARNING "eth16i.c No Eth16i card found (i/o = 0x%x).\n", |
1473 | io[this_dev]); | 1469 | io[this_dev]); |