[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220512085244.30265-1-linmq006@gmail.com>
Date: Thu, 12 May 2022 12:52:41 +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_get_ocotp
of_find_compatible_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: 1bff2d76ac88 ("ARM: mxs: move mxs_get_ocotp() into mach-mxs.c")
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..4af4c3dcfa85 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -99,6 +99,7 @@ static const u32 *mxs_get_ocotp(void)
np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
ocotp_base = of_iomap(np, 0);
WARN_ON(!ocotp_base);
+ of_node_put(np);
mutex_lock(&ocotp_mutex);
--
2.25.1
Powered by blists - more mailing lists