mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 13:54:57 +08:00
remoteproc: imx_rproc: Fix refcount leak in imx_rproc_addr_init
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:6e962bfe56
("remoteproc: imx_rproc: add missing of_node_put") Fixes:a0ff4aa6f0
("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>
This commit is contained in:
parent
2d1ea19f17
commit
61afafe8b9
@ -594,16 +594,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user