aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/cpcihp_generic.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-01-20 08:15:54 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-02-22 19:17:02 -0500
commit0bf01c3c86d4b9ea279d6215420484db887f5db5 (patch)
tree5d967d0a3d4c81183c2782a1786cdcd0aedcd872 /drivers/pci/hotplug/cpcihp_generic.c
parent41a68a748bbc61f5bcea999e33ba72926dfbe6f7 (diff)
PCI: hotplug/cpcihp, fix pci device refcounting
Stanse found an ommitted pci_dev_put on one error path in cpcihp_generic_init. The path is taken on !dev, but also when dev->hdr_type != PCI_HEADER_TYPE_BRIDGE. However it omits to pci_dev_put on the latter. As it is fine to pass NULL to pci_dev_put, put it in there uncoditionally. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Scott Murray <scott@spiteful.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/cpcihp_generic.c')
-rw-r--r--drivers/pci/hotplug/cpcihp_generic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c
index 148fb463b81c..fb3f84661bdc 100644
--- a/drivers/pci/hotplug/cpcihp_generic.c
+++ b/drivers/pci/hotplug/cpcihp_generic.c
@@ -162,6 +162,7 @@ static int __init cpcihp_generic_init(void)
162 dev = pci_get_slot(bus, PCI_DEVFN(bridge_slot, 0)); 162 dev = pci_get_slot(bus, PCI_DEVFN(bridge_slot, 0));
163 if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { 163 if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
164 err("Invalid bridge device %s", bridge); 164 err("Invalid bridge device %s", bridge);
165 pci_dev_put(dev);
165 return -EINVAL; 166 return -EINVAL;
166 } 167 }
167 bus = dev->subordinate; 168 bus = dev->subordinate;