From b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963 Mon Sep 17 00:00:00 2001 From: Date: Thu, 12 May 2005 20:11:55 -0400 Subject: [netdrvr] Fix register_netdev() races in older ISA net drivers --- drivers/net/hp.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'drivers/net/hp.c') diff --git a/drivers/net/hp.c b/drivers/net/hp.c index 026888611d6f..59cf841b14ab 100644 --- a/drivers/net/hp.c +++ b/drivers/net/hp.c @@ -123,12 +123,7 @@ struct net_device * __init hp_probe(int unit) err = do_hp_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); @@ -227,7 +222,12 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr) ei_status.block_output = &hp_block_output; hp_init_card(dev); + retval = register_netdev(dev); + if (retval) + goto out1; return 0; +out1: + free_irq(dev->irq, dev); out: release_region(ioaddr, HP_IO_EXTENT); return retval; @@ -432,11 +432,8 @@ init_module(void) dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; if (do_hp_probe(dev) == 0) { - if (register_netdev(dev) == 0) { - dev_hp[found++] = dev; - continue; - } - cleanup_card(dev); + dev_hp[found++] = dev; + continue; } free_netdev(dev); printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]); -- cgit v1.2.2