All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liang He <windhl@126.com>
To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org,
	clg@kaod.org, christophe.leroy@csgroup.eu
Cc: linuxppc-dev@lists.ozlabs.org, windhl@126.com
Subject: [PATCH] powerpc/pasemi: Fix refcount leak bug
Date: Mon, 20 Jun 2022 23:12:02 +0800	[thread overview]
Message-ID: <20220620151202.4075170-1-windhl@126.com> (raw)

In pas_pci_init(), we need one of_node_put() for of_find_node_by_path()
to keep refcount balance.

Signed-off-by: Liang He <windhl@126.com>
---
 arch/powerpc/platforms/pasemi/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index 55f0160910bf..4b371fb0d9aa 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -282,6 +282,7 @@ void __init pas_pci_init(void)
 	pci_set_flags(PCI_SCAN_ALL_PCIE_DEVS);
 
 	np = of_find_compatible_node(root, NULL, "pasemi,rootbus");
+	of_node_put(root);
 	if (np) {
 		res = pas_add_bridge(np);
 		of_node_put(np);
-- 
2.25.1


                 reply	other threads:[~2022-06-20 15:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220620151202.4075170-1-windhl@126.com \
    --to=windhl@126.com \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=clg@kaod.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.