Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 5.10.y] remoteproc: imx_rproc: Fix refcount leak in imx_rproc_addr_init
@ 2026-11-20  1:13 Nobuhiro Iwamatsu
  2026-11-20 20:39 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Nobuhiro Iwamatsu @ 2026-11-20  1:13 UTC (permalink / raw)
  To: stable; +Cc: gregkh, sashal, Miaoqian Lin, Mathieu Poirier, Nobuhiro Iwamatsu

From: Miaoqian Lin <linmq006@gmail.com>

commit 61afafe8b938bc74841cf4b1a73dd08b9d287c5a upstream.

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not needed anymore.
This function has two paths missing of_node_put().

Fixes: 6e962bfe56b9 ("remoteproc: imx_rproc: add missing of_node_put")
Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220512045558.7142-1-linmq006@gmail.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro.iwamatsu.x90@mail.toshiba>
---
 drivers/remoteproc/imx_rproc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 373fce8b9106..95b17eaa216e 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -290,9 +290,12 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
 		if (!node)
 			continue;
 		/* Not map vdevbuffer, vdevring region */
-		if (!strncmp(node->name, "vdev", strlen("vdev")))
+		if (!strncmp(node->name, "vdev", strlen("vdev"))) {
+			of_node_put(node);
 			continue;
+		}
 		err = of_address_to_resource(node, 0, &res);
+		of_node_put(node);
 		if (err) {
 			dev_err(dev, "unable to resolve memory region\n");
 			return err;
-- 
2.55.0



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

end of thread, other threads:[~2026-11-20 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  1:13 [PATCH 5.10.y] remoteproc: imx_rproc: Fix refcount leak in imx_rproc_addr_init Nobuhiro Iwamatsu
2026-11-20 20:39 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox