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

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
...@@ -129,10 +129,9 @@ void of_pci_dma_configure(struct pci_dev *pci_dev) ...@@ -129,10 +129,9 @@ void of_pci_dma_configure(struct pci_dev *pci_dev)
struct device *dev = &pci_dev->dev; struct device *dev = &pci_dev->dev;
struct device *bridge = pci_get_host_bridge_device(pci_dev); struct device *bridge = pci_get_host_bridge_device(pci_dev);
if (!bridge->parent) if (bridge->parent)
return; of_dma_configure(dev, bridge->parent->of_node);
of_dma_configure(dev, bridge->parent->of_node);
pci_put_host_bridge_device(bridge); pci_put_host_bridge_device(bridge);
} }
EXPORT_SYMBOL_GPL(of_pci_dma_configure); EXPORT_SYMBOL_GPL(of_pci_dma_configure);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment