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/es3210.c | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/es3210.c')
-rw-r--r-- | drivers/net/es3210.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/net/es3210.c b/drivers/net/es3210.c index f1e8150ed2a0..50f8e23bb9e5 100644 --- a/drivers/net/es3210.c +++ b/drivers/net/es3210.c | |||
@@ -177,12 +177,7 @@ struct net_device * __init es_probe(int unit) | |||
177 | err = do_es_probe(dev); | 177 | err = do_es_probe(dev); |
178 | if (err) | 178 | if (err) |
179 | goto out; | 179 | goto out; |
180 | err = register_netdev(dev); | ||
181 | if (err) | ||
182 | goto out1; | ||
183 | return dev; | 180 | return dev; |
184 | out1: | ||
185 | cleanup_card(dev); | ||
186 | out: | 181 | out: |
187 | free_netdev(dev); | 182 | free_netdev(dev); |
188 | return ERR_PTR(err); | 183 | return ERR_PTR(err); |
@@ -310,6 +305,10 @@ static int __init es_probe1(struct net_device *dev, int ioaddr) | |||
310 | dev->poll_controller = ei_poll; | 305 | dev->poll_controller = ei_poll; |
311 | #endif | 306 | #endif |
312 | NS8390_init(dev, 0); | 307 | NS8390_init(dev, 0); |
308 | |||
309 | retval = register_netdev(dev); | ||
310 | if (retval) | ||
311 | goto out1; | ||
313 | return 0; | 312 | return 0; |
314 | out1: | 313 | out1: |
315 | free_irq(dev->irq, dev); | 314 | free_irq(dev->irq, dev); |
@@ -445,11 +444,8 @@ init_module(void) | |||
445 | dev->base_addr = io[this_dev]; | 444 | dev->base_addr = io[this_dev]; |
446 | dev->mem_start = mem[this_dev]; | 445 | dev->mem_start = mem[this_dev]; |
447 | if (do_es_probe(dev) == 0) { | 446 | if (do_es_probe(dev) == 0) { |
448 | if (register_netdev(dev) == 0) { | 447 | dev_es3210[found++] = dev; |
449 | dev_es3210[found++] = dev; | 448 | continue; |
450 | continue; | ||
451 | } | ||
452 | cleanup_card(dev); | ||
453 | } | 449 | } |
454 | free_netdev(dev); | 450 | free_netdev(dev); |
455 | printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]); | 451 | printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]); |