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/cs89x0.c | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/cs89x0.c')
-rw-r--r-- | drivers/net/cs89x0.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 5c5f540da26a..25e4495de79e 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -319,13 +319,7 @@ struct net_device * __init cs89x0_probe(int unit) | |||
319 | } | 319 | } |
320 | if (err) | 320 | if (err) |
321 | goto out; | 321 | goto out; |
322 | err = register_netdev(dev); | ||
323 | if (err) | ||
324 | goto out1; | ||
325 | return dev; | 322 | return dev; |
326 | out1: | ||
327 | outw(PP_ChipID, dev->base_addr + ADD_PORT); | ||
328 | release_region(dev->base_addr, NETCARD_IO_EXTENT); | ||
329 | out: | 323 | out: |
330 | free_netdev(dev); | 324 | free_netdev(dev); |
331 | printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP\n"); | 325 | printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP\n"); |
@@ -735,7 +729,13 @@ printk("PP_addr=0x%x\n", inw(ioaddr + ADD_PORT)); | |||
735 | printk("\n"); | 729 | printk("\n"); |
736 | if (net_debug) | 730 | if (net_debug) |
737 | printk("cs89x0_probe1() successful\n"); | 731 | printk("cs89x0_probe1() successful\n"); |
732 | |||
733 | retval = register_netdev(dev); | ||
734 | if (retval) | ||
735 | goto out3; | ||
738 | return 0; | 736 | return 0; |
737 | out3: | ||
738 | outw(PP_ChipID, dev->base_addr + ADD_PORT); | ||
739 | out2: | 739 | out2: |
740 | release_region(ioaddr & ~3, NETCARD_IO_EXTENT); | 740 | release_region(ioaddr & ~3, NETCARD_IO_EXTENT); |
741 | out1: | 741 | out1: |
@@ -1831,13 +1831,6 @@ init_module(void) | |||
1831 | if (ret) | 1831 | if (ret) |
1832 | goto out; | 1832 | goto out; |
1833 | 1833 | ||
1834 | if (register_netdev(dev) != 0) { | ||
1835 | printk(KERN_ERR "cs89x0.c: No card found at 0x%x\n", io); | ||
1836 | ret = -ENXIO; | ||
1837 | outw(PP_ChipID, dev->base_addr + ADD_PORT); | ||
1838 | release_region(dev->base_addr, NETCARD_IO_EXTENT); | ||
1839 | goto out; | ||
1840 | } | ||
1841 | dev_cs89x0 = dev; | 1834 | dev_cs89x0 = dev; |
1842 | return 0; | 1835 | return 0; |
1843 | out: | 1836 | out: |