Commit 37efbe20 authored by Suthikulpanit, Suravee's avatar Suthikulpanit, Suravee Committed by Rafael J. Wysocki
Browse files

of/pci: Fix pci_get_host_bridge_device leak



In case of error, the current code return w/o calling
pci_put_host_bridge_device. This patch fixes this.

Signed-off-by: default avatarSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent ab3d5273
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -129,10 +129,9 @@ void of_pci_dma_configure(struct pci_dev *pci_dev)
	struct device *dev = &pci_dev->dev;
	struct device *bridge = pci_get_host_bridge_device(pci_dev);

	if (!bridge->parent)
		return;

	if (bridge->parent)
		of_dma_configure(dev, bridge->parent->of_node);

	pci_put_host_bridge_device(bridge);
}
EXPORT_SYMBOL_GPL(of_pci_dma_configure);