[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220402013322.2410228-1-lv.ruyi@zte.com.cn>
Date: Sat, 2 Apr 2022 01:33:22 +0000
From: cgel.zte@...il.com
To: linux@...linux.org.uk
Cc: shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
festevam@...il.com, linux-imx@....com, lv.ruyi@....com.cn,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] fix refcount leak in mxs_get_ocotp()
From: Lv Ruyi <lv.ruyi@....com.cn>
The of_find_compatible_node() function returns a node pointer with
refcount incremented, use of_node_put() on it when done.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>
---
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..6eb731f38727 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -98,6 +98,7 @@ static const u32 *mxs_get_ocotp(void)
np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
ocotp_base = of_iomap(np, 0);
+ of_node_put(np);
WARN_ON(!ocotp_base);
mutex_lock(&ocotp_mutex);
--
2.25.1
Powered by blists - more mailing lists