[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220603120314.15488-1-linmq006@gmail.com>
Date: Fri, 3 Jun 2022 16:03:13 +0400
From: Miaoqian Lin <linmq006@...il.com>
To: Russell King <linux@...linux.org.uk>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Miaoqian Lin <linmq006@...il.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ARM: mxs: Fix refcount leak in mxs_machine_init
of_find_node_by_path() returns remote device nodepointer with
refcount incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: format:2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
arch/arm/mach-mxs/mach-mxs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 25c9d184fa4c..7d957cadd3e9 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -393,6 +393,7 @@ static void __init mxs_machine_init(void)
root = of_find_node_by_path("/");
ret = of_property_read_string(root, "model", &soc_dev_attr->machine);
+ of_node_put(root);
if (ret)
return;
--
2.25.1
Powered by blists - more mailing lists