Skip to content

Commit

Permalink
PCI: Drop references acquired by of_parse_phandle()
Browse files Browse the repository at this point in the history
of_parse_phandle() returns a device_node pointer with the refcount
incremented.  We should dispose of this reference when we're finished.

Drop the reference acquired by of_parse_phandle().

Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Lorenzo Pieralisi <[email protected]>
  • Loading branch information
bjorn-helgaas committed Aug 20, 2015
1 parent 2291ec0 commit 3a10766
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/pci/host/pci-mvebu.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ static void mvebu_pcie_msi_enable(struct mvebu_pcie *pcie)
return;

pcie->msi = of_pci_find_msi_chip_by_node(msi_node);
of_node_put(msi_node);

if (pcie->msi)
pcie->msi->dev = &pcie->pdev->dev;
Expand Down
1 change: 1 addition & 0 deletions drivers/pci/host/pci-xgene.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ static int xgene_pcie_msi_enable(struct pci_bus *bus)
if (!bus->msi)
return -ENODEV;

of_node_put(msi_node);
bus->msi->dev = &bus->dev;
return 0;
}
Expand Down

0 comments on commit 3a10766

Please sign in to comment.