Showing error 809

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/fakephp.c
Line in file: 322
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

292}
293
294/* called from the single-threaded workqueue handler to rescan all pci buses */
295static void pci_rescan_worker(struct work_struct *work)
296{
297        pci_rescan();
298}
299
300static int enable_slot(struct hotplug_slot *hotplug_slot)
301{
302        /* mis-use enable_slot for rescanning of the pci bus */
303        cancel_work_sync(&pci_rescan_work);
304        queue_work(dummyphp_wq, &pci_rescan_work);
305        return 0;
306}
307
308static int disable_slot(struct hotplug_slot *slot)
309{
310        struct dummy_slot *dslot;
311        struct pci_dev *dev;
312        int func;
313
314        if (!slot)
315                return -ENODEV;
316        dslot = slot->private;
317
318        dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(slot));
319
320        for (func = 7; func >= 0; func--) {
321                dev = pci_get_slot(dslot->dev->bus, dslot->dev->devfn + func);
322                if (!dev)
323                        continue;
324
325                if (test_and_set_bit(0, &dslot->removed)) {
326                        dbg("Slot already scheduled for removal\n");
327                        return -ENODEV;
328                }
329
330                /* remove the device from the pci core */
331                pci_remove_bus_device(dev);
332
Show full sources