summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2022-07-01 15:17:50 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2022-09-05 09:30:25 +0200
commit110a1fcb6c4d55144d8179983a475f17a1d6f832 (patch)
treea3d90a34d67284cfa6afce050fa04aec4852a000
parentpowerpc/pseries: Add missing of_node_put()s in hotplug-cpu.c (diff)
downloadlinux-110a1fcb6c4d55144d8179983a475f17a1d6f832.tar.xz
linux-110a1fcb6c4d55144d8179983a475f17a1d6f832.zip
powerpc/pci_dn: Add missing of_node_put()
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: cca87d303c85 ("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
-rw-r--r--arch/powerpc/kernel/pci_dn.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 7a35fc25a304..38561d6a2079 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -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);