All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liang He <windhl@126.com>
To: tony@atomide.com, linux-omap@vger.kernel.org, windhl@126.com
Subject: [PATCH v3] arm: mach-omap2: omap4-common: Fix refcount leak bug
Date: Tue, 28 Jun 2022 19:29:39 +0800	[thread overview]
Message-ID: <20220628112939.160737-1-windhl@126.com> (raw)

In omap4_sram_init(), of_find_compatible_node() will return a node
pointer with refcount incremented. We should use of_node_put() when
it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
---
 changelog:

 v3: change the order of of_node_put() based on tony's advice
 v2: merge similar bugs in omap2 into one commit
 v1: fix missing of_node_put() bugs


 arch/arm/mach-omap2/omap4-common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 6d1eb4eefefe..d9ed2a5dcd5e 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -140,6 +140,7 @@ static int __init omap4_sram_init(void)
 			__func__);
 	else
 		sram_sync = (void __iomem *)gen_pool_alloc(sram_pool, PAGE_SIZE);
+	of_node_put(np);
 
 	return 0;
 }
-- 
2.25.1


             reply	other threads:[~2022-06-28 11:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 11:29 Liang He [this message]
2022-07-04  7:26 ` [PATCH v3] arm: mach-omap2: omap4-common: Fix refcount leak bug Tony Lindgren

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=20220628112939.160737-1-windhl@126.com \
    --to=windhl@126.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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.