Showing error 845

User: Jiri Slaby
Error type: Resource Leak
Error type description: The code omits to put the resource to the system for reuse
File location: drivers/pci/hotplug/acpiphp_glue.c
Line in file: 553
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

 523        return;
 524}
 525
 526
 527/* callback routine to find P2P bridges */
 528static acpi_status
 529find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
 530{
 531        acpi_status status;
 532        acpi_handle dummy_handle;
 533        unsigned long long tmp;
 534        int device, function;
 535        struct pci_dev *dev;
 536        struct pci_bus *pci_bus = context;
 537
 538        status = acpi_get_handle(handle, "_ADR", &dummy_handle);
 539        if (ACPI_FAILURE(status))
 540                return AE_OK;                /* continue */
 541
 542        status = acpi_evaluate_integer(handle, "_ADR", NULL, &tmp);
 543        if (ACPI_FAILURE(status)) {
 544                dbg("%s: _ADR evaluation failure\n", __func__);
 545                return AE_OK;
 546        }
 547
 548        device = (tmp >> 16) & 0xffff;
 549        function = tmp & 0xffff;
 550
 551        dev = pci_get_slot(pci_bus, PCI_DEVFN(device, function));
 552
 553        if (!dev || !dev->subordinate)
 554                goto out;
 555
 556        /* check if this bridge has ejectable slots */
 557        if ((detect_ejectable_slots(handle) > 0)) {
 558                dbg("found PCI-to-PCI bridge at PCI %s\n", pci_name(dev));
 559                add_p2p_bridge(handle, dev);
 560        }
 561
 562        /* search P2P bridges under this p2p bridge */
 563        status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, (u32)1,
Show full sources