]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
PCI: acpiphp: fix function 0 leak when disabling a slot
authorAmos Kong <kongjianjun@gmail.com>
Wed, 23 May 2012 03:58:40 +0000 (21:58 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 13 Jun 2012 22:38:06 +0000 (16:38 -0600)
Previously, we acquired two references to function 0, but only released
one.

[bhelgaas: split this out from "remove all functions" fix]
Signed-off-by: Amos Kong <kongjianjun@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/hotplug/acpiphp_glue.c

index 62d0ae4dfcada986fa7acd29cc1a39e2fce579d8..c8f999102765cbe3bbb8497f98c75d2d14094874 100644 (file)
@@ -893,6 +893,7 @@ static int disable_device(struct acpiphp_slot *slot)
        pdev = pci_get_slot(bus, PCI_DEVFN(slot->device, 0));
        if (!pdev)
                goto err_exit;
+       pci_dev_put(pdev);
 
        list_for_each_entry(func, &slot->funcs, sibling) {
                if (func->bridge) {