diff mbox series

powerpc/fsl_pci: Remove of_node_put() when reference escaped out

Message ID 20220720124557.1256243-1-windhl@126.com (mailing list archive)
State Accepted
Headers show
Series powerpc/fsl_pci: Remove of_node_put() when reference escaped out | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 10 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 10 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 7 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 23 jobs.

Commit Message

Liang He July 20, 2022, 12:45 p.m. UTC
In fsl_pci_assign_primary(), we should remove the of_node_put()
when breaking out of the for_each_matching_node() as the 'np'
is escaped out by global 'fsl_pci_primary'.

Fixes: 905e75c46dba ("powerpc/fsl-pci: Unify pci/pcie initialization code")
Signed-off-by: Liang He <windhl@126.com>
---
 arch/powerpc/sysdev/fsl_pci.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Michael Ellerman Sept. 9, 2022, 12:07 p.m. UTC | #1
On Wed, 20 Jul 2022 20:45:57 +0800, Liang He wrote:
> In fsl_pci_assign_primary(), we should remove the of_node_put()
> when breaking out of the for_each_matching_node() as the 'np'
> is escaped out by global 'fsl_pci_primary'.
> 
> 

Applied to powerpc/next.

[1/1] powerpc/fsl_pci: Remove of_node_put() when reference escaped out
      https://git.kernel.org/powerpc/c/afa6a472a3d2a8dd477b285eeb67b3593546647b

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index e8d072e98b66..aa7faa19c6ef 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1134,7 +1134,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;
 		}
 	}