Skip to content

Commit

Permalink
of/pci: Fix pci_get_host_bridge_device leak
Browse files Browse the repository at this point in the history
In case of error, the current code return w/o calling
pci_put_host_bridge_device. This patch fixes this.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Suthikulpanit, Suravee authored and Rafael J. Wysocki committed Nov 7, 2015
1 parent ab3d527 commit 37efbe2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/of/of_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37efbe2

Please sign in to comment.