Showing error 853

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: 279
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

 249                slot->sun = sun;
 250                INIT_LIST_HEAD(&slot->funcs);
 251                mutex_init(&slot->crit_sect);
 252
 253                slot->next = bridge->slots;
 254                bridge->slots = slot;
 255
 256                bridge->nr_slots++;
 257
 258                dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n",
 259                                slot->sun, pci_domain_nr(bridge->pci_bus),
 260                                bridge->pci_bus->number, slot->device);
 261                retval = acpiphp_register_hotplug_slot(slot);
 262                if (retval) {
 263                        if (retval == -EBUSY)
 264                                warn("Slot %llu already registered by another "
 265                                        "hotplug driver\n", slot->sun);
 266                        else
 267                                warn("acpiphp_register_hotplug_slot failed "
 268                                        "(err code = 0x%x)\n", retval);
 269                        goto err_exit;
 270                }
 271        }
 272
 273        newfunc->slot = slot;
 274        list_add_tail(&newfunc->sibling, &slot->funcs);
 275
 276        /* associate corresponding pci_dev */
 277        newfunc->pci_dev = pci_get_slot(bridge->pci_bus,
 278                                         PCI_DEVFN(device, function));
 279        if (newfunc->pci_dev) {
 280                slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
 281        }
 282
 283        if (is_dock_device(handle)) {
 284                /* we don't want to call this device's _EJ0
 285                 * because we want the dock notify handler
 286                 * to call it after it calls _DCK
 287                 */
 288                newfunc->flags &= ~FUNC_HAS_EJ0;
 289                if (register_hotplug_dock_device(handle,
Show full sources