Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9aa17a77 authored by Lorenzo Pieralisi's avatar Lorenzo Pieralisi Committed by Bjorn Helgaas
Browse files

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: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
parent 5c3f18cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -448,7 +448,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
	u32 val;
	u32 val;
	LIST_HEAD(res);
	LIST_HEAD(res);


	host = pci_alloc_host_bridge(sizeof(*p));
	host = devm_pci_alloc_host_bridge(dev, sizeof(*p));
	if (!host)
	if (!host)
		return -ENOMEM;
		return -ENOMEM;