Commit e807d97a authored by Randy Dunlap's avatar Randy Dunlap Committed by Stephen Hemminger

[PATCH] janitor: ns83820 error handling

Subject: Re: [Kernel-janitors] [PATCH] insert missing free_irq and fix 	cleanup path
From: Leann Ogasawara <ogasawara@osdl.org>

On Thu, 2003-09-04 at 13:17, Benjamin LaHaise wrote:
> The if()s before free are redundant, turf them and it's good.
parent 437155f4
...@@ -1833,13 +1833,13 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ ...@@ -1833,13 +1833,13 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
if (err) { if (err) {
printk(KERN_INFO "ns83820: unable to register irq %d\n", printk(KERN_INFO "ns83820: unable to register irq %d\n",
pci_dev->irq); pci_dev->irq);
goto out_unmap; goto out_disable;
} }
err = register_netdev(&dev->net_dev); err = register_netdev(&dev->net_dev);
if (err) { if (err) {
printk(KERN_INFO "ns83820: unable to register netdev: %d\n", err); printk(KERN_INFO "ns83820: unable to register netdev: %d\n", err);
goto out_unmap; goto out_free_irq;
} }
printk("%s: ns83820.c: 0x22c: %08x, subsystem: %04x:%04x\n", printk("%s: ns83820.c: 0x22c: %08x, subsystem: %04x:%04x\n",
...@@ -2025,9 +2025,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ ...@@ -2025,9 +2025,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
return 0; return 0;
out_unmap: out_free_irq:
iounmap(dev->base); free_irq(pci_dev->irq, dev);
out_disable: out_disable:
if (dev->base)
iounmap(dev->base);
pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_TX_DESC, dev->tx_descs, dev->tx_phy_descs); pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_TX_DESC, dev->tx_descs, dev->tx_phy_descs);
pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_RX_DESC, dev->rx_info.descs, dev->rx_info.phy_descs); pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_RX_DESC, dev->rx_info.descs, dev->rx_info.phy_descs);
pci_disable_device(pci_dev); pci_disable_device(pci_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment