]> git.hungrycats.org Git - linux/commitdiff
[PATCH] janitor: ns83820 error handling
authorRandy Dunlap <rddunlap@osdl.org>
Sat, 20 Sep 2003 10:00:00 +0000 (06:00 -0400)
committerStephen Hemminger <shemminger@osdl.org>
Sat, 20 Sep 2003 10:00:00 +0000 (06:00 -0400)
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.

drivers/net/ns83820.c

index 0e315b8d37537662b5bb7cb25f1dcec4f1b47031..67d71fc92eb56b14432dcfc98692a814b7f99513 100644 (file)
@@ -1833,13 +1833,13 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
        if (err) {
                printk(KERN_INFO "ns83820: unable to register irq %d\n",
                        pci_dev->irq);
-               goto out_unmap;
+               goto out_disable;
        }
 
        err = register_netdev(&dev->net_dev);
        if (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",
@@ -2025,9 +2025,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
 
        return 0;
 
-out_unmap:
-       iounmap(dev->base);
+out_free_irq:
+       free_irq(pci_dev->irq, dev);
 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_RX_DESC, dev->rx_info.descs, dev->rx_info.phy_descs);
        pci_disable_device(pci_dev);