Skip to content

Commit

Permalink
powerpc/pci_dn: Add missing of_node_put()
Browse files Browse the repository at this point in the history
[ Upstream commit 110a1fc ]

In pci_add_device_node_info(), use of_node_put() to drop the reference
to 'parent' returned by of_get_parent() to keep refcount balance.

Fixes: cca87d3 ("powerpc/pci: Refactor pci_dn")
Co-authored-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Link: https://lore.kernel.org/r/20220701131750.240170-1-windhl@126.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
2 people authored and gregkh committed Oct 21, 2022
1 parent 594e0fc commit c3af1e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/kernel/pci_dn.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ struct pci_dn *pci_add_device_node_info(struct pci_controller *hose,
INIT_LIST_HEAD(&pdn->list);
parent = of_get_parent(dn);
pdn->parent = parent ? PCI_DN(parent) : NULL;
of_node_put(parent);
if (pdn->parent)
list_add_tail(&pdn->list, &pdn->parent->child_list);

Expand Down

0 comments on commit c3af1e0

Please sign in to comment.