From: Peng Wu <wupeng58@huawei.com>
To: <linus.walleij@linaro.org>, <linux@armlinux.org.uk>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <liwei391@huawei.com>,
<wangxiongfeng2@huawei.com>, Peng Wu <wupeng58@huawei.com>
Subject: [PATCH -next] ARM: versatile: Add missing of_node_put in dcscb_init
Date: Mon, 25 Apr 2022 08:14:16 +0000 [thread overview]
Message-ID: <20220425081416.22836-1-wupeng58@huawei.com> (raw)
The device_node pointer is returned by of_find_compatible_node
with refcount incremented. We should use of_node_put() to avoid
the refcount leak.
Signed-off-by: Peng Wu <wupeng58@huawei.com>
---
arch/arm/mach-versatile/dcscb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-versatile/dcscb.c b/arch/arm/mach-versatile/dcscb.c
index 866270e7f271..d8797350996d 100644
--- a/arch/arm/mach-versatile/dcscb.c
+++ b/arch/arm/mach-versatile/dcscb.c
@@ -144,6 +144,7 @@ static int __init dcscb_init(void)
if (!node)
return -ENODEV;
dcscb_base = of_iomap(node, 0);
+ of_node_put(node);
if (!dcscb_base)
return -EADDRNOTAVAIL;
cfg = readl_relaxed(dcscb_base + DCS_CFG_R);
--
2.17.1
next reply other threads:[~2022-04-25 8:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 8:14 Peng Wu [this message]
2022-04-28 23:04 ` Linus Walleij
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=20220425081416.22836-1-wupeng58@huawei.com \
--to=wupeng58@huawei.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=liwei391@huawei.com \
--cc=wangxiongfeng2@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®