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/isa-skeleton.c | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/isa-skeleton.c')
-rw-r--r-- | drivers/net/isa-skeleton.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c index 50bebb55e9ee..88ae8a04fabc 100644 --- a/drivers/net/isa-skeleton.c +++ b/drivers/net/isa-skeleton.c @@ -176,12 +176,7 @@ struct net_device * __init netcard_probe(int unit) err = do_netcard_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); @@ -316,7 +311,15 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr) dev->tx_timeout = &net_tx_timeout; dev->watchdog_timeo = MY_TX_TIMEOUT; + + err = register_netdev(dev); + if (err) + goto out2; return 0; +out2: +#ifdef jumpered_dma + free_dma(dev->dma); +#endif out1: #ifdef jumpered_interrupts free_irq(dev->irq, dev); @@ -691,11 +694,8 @@ int init_module(void) dev->dma = dma; dev->mem_start = mem; if (do_netcard_probe(dev) == 0) { - if (register_netdev(dev) == 0) - this_device = dev; - return 0; - } - cleanup_card(dev); + this_device = dev; + return 0; } free_netdev(dev); return -ENXIO; |