diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-11-28 03:58:46 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-11-28 03:58:46 +0000 |
commit | b63ad0882a16a5d28003e57f2b0b81dee3fb322b (patch) | |
tree | 0a343ce219e2b8b38a5d702d66032c57b83d9720 /drivers/net/aironet4500_card.c | |
parent | a9d7bff9a84dba79609a0002e5321b74c4d64c64 (diff) |
Merge with 2.4.0-test11.
Diffstat (limited to 'drivers/net/aironet4500_card.c')
-rw-r--r-- | drivers/net/aironet4500_card.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/aironet4500_card.c b/drivers/net/aironet4500_card.c index 11b6e2773..e581d6e32 100644 --- a/drivers/net/aironet4500_card.c +++ b/drivers/net/aironet4500_card.c @@ -164,16 +164,23 @@ int awc4500_pci_probe(struct net_device *dev) static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev, int ioaddr, int cis_addr, int mem_addr, u8 pci_irq_line) { - int i; + int i, allocd_dev = 0; if (!dev) { - dev = init_etherdev(dev, 0 ); + dev = init_etherdev(NULL, 0); + if (!dev) + return -ENOMEM; + allocd_dev = 1; } dev->priv = kmalloc(sizeof(struct awc_private),GFP_KERNEL ); memset(dev->priv,0,sizeof(struct awc_private)); if (!dev->priv) { printk(KERN_CRIT "aironet4x00: could not allocate device private, some unstability may follow\n"); - return -1; + if (allocd_dev) { + unregister_netdev(dev); + kfree(dev); + } + return -ENOMEM; }; // ether_setup(dev); @@ -194,7 +201,16 @@ static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev, dev->watchdog_timeo = AWC_TX_TIMEOUT; - request_irq(dev->irq,awc_interrupt, SA_SHIRQ | SA_INTERRUPT ,"Aironet 4X00",dev); + i = request_irq(dev->irq,awc_interrupt, SA_SHIRQ | SA_INTERRUPT, dev->name, dev); + if (i) { + kfree(dev->priv); + dev->priv = NULL; + if (allocd_dev) { + unregister_netdev(dev); + kfree(dev); + } + return i; + } awc_private_init( dev); awc_init(dev); |