aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hp-plus.c
diff options
context:
space:
mode:
author <herbert@gondor.apana.org.au>2005-05-12 20:11:55 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-12 20:11:55 -0400
commitb1fc5505e0dbcc3fd7c75bfe6bee39ec50080963 (patch)
treef8c0bb679dc8e72816e16820c3dbcccf924097eb /drivers/net/hp-plus.c
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/hp-plus.c')
-rw-r--r--drivers/net/hp-plus.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c
index 4834314b676d..0abf5dd08b4c 100644
--- a/drivers/net/hp-plus.c
+++ b/drivers/net/hp-plus.c
@@ -159,12 +159,7 @@ struct net_device * __init hp_plus_probe(int unit)
159 err = do_hpp_probe(dev); 159 err = do_hpp_probe(dev);
160 if (err) 160 if (err)
161 goto out; 161 goto out;
162 err = register_netdev(dev);
163 if (err)
164 goto out1;
165 return dev; 162 return dev;
166out1:
167 cleanup_card(dev);
168out: 163out:
169 free_netdev(dev); 164 free_netdev(dev);
170 return ERR_PTR(err); 165 return ERR_PTR(err);
@@ -271,6 +266,9 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
271 /* Leave the 8390 and HP chip reset. */ 266 /* Leave the 8390 and HP chip reset. */
272 outw(inw(ioaddr + HPP_OPTION) & ~EnableIRQ, ioaddr + HPP_OPTION); 267 outw(inw(ioaddr + HPP_OPTION) & ~EnableIRQ, ioaddr + HPP_OPTION);
273 268
269 retval = register_netdev(dev);
270 if (retval)
271 goto out;
274 return 0; 272 return 0;
275out: 273out:
276 release_region(ioaddr, HP_IO_EXTENT); 274 release_region(ioaddr, HP_IO_EXTENT);
@@ -463,11 +461,8 @@ init_module(void)
463 dev->irq = irq[this_dev]; 461 dev->irq = irq[this_dev];
464 dev->base_addr = io[this_dev]; 462 dev->base_addr = io[this_dev];
465 if (do_hpp_probe(dev) == 0) { 463 if (do_hpp_probe(dev) == 0) {
466 if (register_netdev(dev) == 0) { 464 dev_hpp[found++] = dev;
467 dev_hpp[found++] = dev; 465 continue;
468 continue;
469 }
470 cleanup_card(dev);
471 } 466 }
472 free_netdev(dev); 467 free_netdev(dev);
473 printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]); 468 printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]);