From: Lorenzo Pieralisi Date: Wed, 28 Jun 2017 20:13:53 +0000 (-0500) Subject: PCI: faraday: Fix host bridge memory leakage X-Git-Tag: v4.14-rc1~527^2^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9aa17a772084e192a2364340794f0d44ac73dd4c;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Bjorn Helgaas Acked-by: Linus Walleij Cc: Arnd Bergmann --- diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c index 1ad6b25..ce5700e 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;