linux/drivers/pci
Julia Lawall 4ba7d0f0eb drivers/pci/hotplug: Add missing pci_dev_get
pci_get_slot does a pci_dev_get, so pci_dev_put needs to be called in an
error case.

An alterative would be to move the test_and_set_bit before the call to
pci_get_slot.

The problem was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
local idexpression *n;
statement S1,S2;
expression E,E1;
expression *ptr != NULL;
type T,T1;
@@

(
if (!(n = pci_get_slot(...))) S1
|
n = pci_get_slot(...)
)
<... when != pci_dev_put(n)
    when != if (...) { <+... pci_dev_put(n) ...+> }
    when != true !n  || ...
    when != n = (T)E
    when != E = n
if (!n || ...) S2
...>
(
  return \(0\|<+...n...+>\|ptr\);
|
+ pci_dev_put(n);
return ...;
|
pci_dev_put(n);
|
n = (T1)E1
|
E1 = n
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:33 -08:00
..
hotplug drivers/pci/hotplug: Add missing pci_dev_get 2009-01-07 11:12:33 -08:00
pcie ACPI/PCI: PCIe AER _OSC support capabilities called when root bridge added 2009-01-07 11:12:30 -08:00
.gitignore
Kconfig PCI: Add Kconfig option to disable deprecated pci_find_* API 2007-11-05 13:35:17 -08:00
Makefile PCI: add routines for debugging and handling lost interrupts 2008-10-23 14:54:18 -07:00
access.c PCI: Limit VPD read/write lengths for Broadcom 5706, 5708, 5709 rev. 2008-07-02 11:25:54 -07:00
bus.c PCI: Add legacy_io/mem to all busses 2009-01-07 11:12:25 -08:00
dmar.c calculate agaw for each iommu 2009-01-03 14:02:18 +01:00
hotplug-pci.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
hotplug.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
htirq.c genirq: remove sparse irq code 2008-10-16 16:53:15 +02:00
intel-iommu.c intel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICES 2009-01-03 14:11:08 +01:00
intr_remapping.c sparseirq: fix !SMP building, #2 2008-12-17 00:15:55 +01:00
intr_remapping.h VT-d: Changes to support KVM 2008-10-15 14:24:08 +02:00
iova.c VT-d: Changes to support KVM 2008-10-15 14:24:08 +02:00
irq.c PCI: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-07 11:12:23 -08:00
msi.c ACPI/PCI: PCI MSI _OSC support capabilities called when root bridge added 2009-01-07 11:12:31 -08:00
msi.h
pci-acpi.c ACPI/PCI: remove obsolete _OSC capability support functions 2009-01-07 11:12:32 -08:00
pci-driver.c PCI: Rework default handling of suspend and resume 2009-01-06 10:44:32 -08:00
pci-sysfs.c resource: allow MMIO exclusivity for device drivers 2009-01-07 11:12:32 -08:00
pci.c resource: allow MMIO exclusivity for device drivers 2009-01-07 11:12:32 -08:00
pci.h ACPI/PCI: PCI MSI _OSC support capabilities called when root bridge added 2009-01-07 11:12:31 -08:00
probe.c PCI: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-07 11:12:23 -08:00
proc.c PCI: check mmap range of /proc/bus/pci files too 2009-01-07 11:12:20 -08:00
quirks.c PCI: fixup whitespace in quirks.c 2009-01-07 11:12:22 -08:00
remove.c PCI: fix sparse warning in pci_remove_behind_bridge 2008-10-20 10:54:25 -07:00
rom.c PCI: remove excess kernel-doc notation 2008-11-03 14:32:46 -08:00
search.c PCI: Fix reference counting bug 2008-10-22 16:42:35 -07:00
setup-bus.c PCI: use resource_size() everywhere. 2008-10-20 10:54:28 -07:00
setup-irq.c PCI: use dev_printk when possible 2008-06-25 16:05:13 -07:00
setup-res.c PCI: use resource_size() everywhere. 2008-10-20 10:54:28 -07:00
slot.c PCI: stop leaking 'slot_name' in pci_create_slot 2008-12-09 14:36:03 -08:00
syscall.c PCI: remove unneeded lock_kernel() in drivers/pci/syscall.c. 2008-02-01 15:04:21 -08:00