for_each_matching_node() will automatically increase and decrease the refcount. As there is a reference escaped out into global 'fsl_pci_primary', we should not use of_node_put() anymore.
Fixes: 905e75c46dba ("powerpc/fsl-pci: Unify pci/pcie initialization code") Signed-off-by: Liang He <win...@126.com> --- arch/powerpc/sysdev/fsl_pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 4c986c955951..d23a56276f42 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -1137,7 +1137,6 @@ void __init fsl_pci_assign_primary(void) for_each_matching_node(np, pci_ids) { if (of_device_is_available(np)) { fsl_pci_primary = np; - of_node_put(np); return; } } -- 2.25.1