[SPARC64]: Add missing pci_dev_put
authorJulia Lawall <julia@diku.dk>
Tue, 20 Nov 2007 06:50:01 +0000 (22:50 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 5 Dec 2007 13:37:57 +0000 (05:37 -0800)
There should be a pci_dev_put when breaking out of a loop that iterates
over calls to pci_get_device and similar functions.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/isa.c

index 0f19dce1c905c699e30361a7f6c6397cffc5c3c7..b5f7b354084f6d91d1da68e2374d7d409f1c5416 100644 (file)
@@ -155,6 +155,7 @@ void __init isa_init(void)
                isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL);
                if (!isa_br) {
                        printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
+                       pci_dev_put(pdev);
                        return;
                }
 
@@ -168,6 +169,7 @@ void __init isa_init(void)
                        printk(KERN_DEBUG "isa: device registration error for %s!\n",
                               dp->path_component_name);
                        kfree(isa_br);
+                       pci_dev_put(pdev);
                        return;
                }