Skip to content

Commit 792abc6

Browse files
Lorenzo Pieralisibjorn-helgaas
authored andcommitted
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>
1 parent 9aa17a7 commit 792abc6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/pci/host/pci-tegra.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,7 @@ static int tegra_pcie_probe(struct platform_device *pdev)
22382238
struct pci_bus *child;
22392239
int err;
22402240

2241-
host = pci_alloc_host_bridge(sizeof(*pcie));
2241+
host = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
22422242
if (!host)
22432243
return -ENOMEM;
22442244

0 commit comments

Comments
 (0)