summaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2018-05-15 11:07:01 +0200
committerBjorn Helgaas <helgaas@kernel.org>2018-05-30 11:34:41 -0500
commit3bbce531788719749520f28052cabdef16af6b16 (patch)
treecd0d7693431b82c0cacce0dbf6705b1c7906365d /drivers/pci/probe.c
parentae07b786888f1872ac2b63d74a17e206d441ec9f (diff)
downloadop-kernel-dev-3bbce531788719749520f28052cabdef16af6b16.zip
op-kernel-dev-3bbce531788719749520f28052cabdef16af6b16.tar.gz
PCI: Fix devm_pci_alloc_host_bridge() memory leak
Fix a memory leak by freeing the PCI resource list in devm_pci_release_host_bridge_dev(). Fixes: 5c3f18cce083 ("PCI: Add devm_pci_alloc_host_bridge() interface") Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ac91b6f..eccf204 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -526,12 +526,14 @@ static void devm_pci_release_host_bridge_dev(struct device *dev)
if (bridge->release_fn)
bridge->release_fn(bridge);
+
+ pci_free_resource_list(&bridge->windows);
}
static void pci_release_host_bridge_dev(struct device *dev)
{
devm_pci_release_host_bridge_dev(dev);
- pci_free_host_bridge(to_pci_host_bridge(dev));
+ kfree(to_pci_host_bridge(dev));
}
struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
OpenPOWER on IntegriCloud