diff options
author | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2017-06-28 22:13:54 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-06-28 22:13:54 +0200 |
commit | 792abc6e2f5a5ab996bf6cc1947b382dda29a82d (patch) | |
tree | 754daadf1829f0e0f94cb12a6fcd6edc965768b4 | |
parent | PCI: faraday: Fix host bridge memory leakage (diff) | |
download | linux-792abc6e2f5a5ab996bf6cc1947b382dda29a82d.tar.xz linux-792abc6e2f5a5ab996bf6cc1947b382dda29a82d.zip |
PCI: tegra: 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>
Cc: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | drivers/pci/host/pci-tegra.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 2618f875a600..84c98a2bffeb 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -2238,7 +2238,7 @@ static int tegra_pcie_probe(struct platform_device *pdev) struct pci_bus *child; int err; - host = pci_alloc_host_bridge(sizeof(*pcie)); + host = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); if (!host) return -ENOMEM; |