提交 37efbe20 编写于 作者: S Suthikulpanit, Suravee 提交者: 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: NSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: NBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 ab3d5273
......@@ -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);
of_dma_configure(dev, bridge->parent->of_node);
pci_put_host_bridge_device(bridge);
}
EXPORT_SYMBOL_GPL(of_pci_dma_configure);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册