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/3c503.c | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/3c503.c')
-rw-r--r-- | drivers/net/3c503.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index 29dfd47f41d2..5c5eebdb6914 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c | |||
@@ -171,12 +171,7 @@ struct net_device * __init el2_probe(int unit) | |||
171 | err = do_el2_probe(dev); | 171 | err = do_el2_probe(dev); |
172 | if (err) | 172 | if (err) |
173 | goto out; | 173 | goto out; |
174 | err = register_netdev(dev); | ||
175 | if (err) | ||
176 | goto out1; | ||
177 | return dev; | 174 | return dev; |
178 | out1: | ||
179 | cleanup_card(dev); | ||
180 | out: | 175 | out: |
181 | free_netdev(dev); | 176 | free_netdev(dev); |
182 | return ERR_PTR(err); | 177 | return ERR_PTR(err); |
@@ -356,6 +351,10 @@ el2_probe1(struct net_device *dev, int ioaddr) | |||
356 | dev->poll_controller = ei_poll; | 351 | dev->poll_controller = ei_poll; |
357 | #endif | 352 | #endif |
358 | 353 | ||
354 | retval = register_netdev(dev); | ||
355 | if (retval) | ||
356 | goto out1; | ||
357 | |||
359 | if (dev->mem_start) | 358 | if (dev->mem_start) |
360 | printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n", | 359 | printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n", |
361 | dev->name, ei_status.name, (wordlength+1)<<3, | 360 | dev->name, ei_status.name, (wordlength+1)<<3, |
@@ -715,11 +714,8 @@ init_module(void) | |||
715 | dev->base_addr = io[this_dev]; | 714 | dev->base_addr = io[this_dev]; |
716 | dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ | 715 | dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ |
717 | if (do_el2_probe(dev) == 0) { | 716 | if (do_el2_probe(dev) == 0) { |
718 | if (register_netdev(dev) == 0) { | 717 | dev_el2[found++] = dev; |
719 | dev_el2[found++] = dev; | 718 | continue; |
720 | continue; | ||
721 | } | ||
722 | cleanup_card(dev); | ||
723 | } | 719 | } |
724 | free_netdev(dev); | 720 | free_netdev(dev); |
725 | printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]); | 721 | printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]); |