linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ARM: versatile: Add missing of_node_put in dcscb_init
@ 2022-04-25  8:14 Peng Wu
  2022-04-28 23:04 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Wu @ 2022-04-25  8:14 UTC (permalink / raw)
  To: linus.walleij, linux
  Cc: linux-arm-kernel, linux-kernel, liwei391, wangxiongfeng2, Peng Wu

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] ARM: versatile: Add missing of_node_put in dcscb_init
  2022-04-25  8:14 [PATCH -next] ARM: versatile: Add missing of_node_put in dcscb_init Peng Wu
@ 2022-04-28 23:04 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-04-28 23:04 UTC (permalink / raw)
  To: Peng Wu; +Cc: linux, linux-arm-kernel, linux-kernel, liwei391, wangxiongfeng2

On Mon, Apr 25, 2022 at 10:18 AM Peng Wu <wupeng58@huawei.com> wrote:

> 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>

I applied this on linux-next. signed off and sent directly to
the SoC tree.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-28 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25  8:14 [PATCH -next] ARM: versatile: Add missing of_node_put in dcscb_init Peng Wu
2022-04-28 23:04 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).