summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2017-06-28 15:13:53 -0500
committerBjorn Helgaas <bhelgaas@google.com>2017-06-28 15:13:53 -0500
commit9aa17a772084e192a2364340794f0d44ac73dd4c (patch)
tree72b852a3432e1281271da53fb38953e2e2afef69 /drivers/pci
parent5c3f18cce08364ef68163228c0b42725d64cd353 (diff)
downloadlinux-9aa17a772084e192a2364340794f0d44ac73dd4c.tar.gz
linux-9aa17a772084e192a2364340794f0d44ac73dd4c.tar.bz2
linux-9aa17a772084e192a2364340794f0d44ac73dd4c.zip
PCI: faraday: Fix host bridge memory leakage
When probing the PCI host controller driver, if an error occurs, the probe function code does not free memory allocated for the struct pci_host_bridge resulting in memory leakage. Move the struct pci_host_bridge allocation over to the respective devm interface to fix the issue. Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/host/pci-ftpci100.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c
index 1ad6b253b325..ce5700eec1da 100644
--- a/drivers/pci/host/pci-ftpci100.c
+++ b/drivers/pci/host/pci-ftpci100.c
@@ -448,7 +448,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
u32 val;
LIST_HEAD(res);
- host = pci_alloc_host_bridge(sizeof(*p));
+ host = devm_pci_alloc_host_bridge(dev, sizeof(*p));
if (!host)
return -ENOMEM;