projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0c1516
)
remoteproc: imx_rproc: Fix refcount leak in imx_rproc_addr_init
author
Miaoqian Lin
<linmq006@gmail.com>
Thu, 12 May 2022 04:55:58 +0000
(08:55 +0400)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:04 +0000
(14:24 +0200)
[ Upstream commit
61afafe8b938bc74841cf4b1a73dd08b9d287c5a
]
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: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/imx_rproc.c
patch
|
blob
|
history
diff --git
a/drivers/remoteproc/imx_rproc.c
b/drivers/remoteproc/imx_rproc.c
index 59eae605ad59f3cc84744fc8decae52fe6b53c67..e8a170ad43c1df82590ee8b8e4edecc922787ff3 100644
(file)
--- a/
drivers/remoteproc/imx_rproc.c
+++ b/
drivers/remoteproc/imx_rproc.c
@@
-586,16
+586,17
@@
static int imx_rproc_addr_init(struct imx_rproc *priv,
node = of_parse_phandle(np, "memory-region", a);
/* 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;
}
- of_node_put(node);
-
if (b >= IMX_RPROC_MEM_MAX)
break;