]> git.baikalelectronics.ru Git - kernel.git/commit
remoteproc: k3-r5: Fix refcount leak in k3_r5_cluster_of_init
authorMiaoqian Lin <linmq006@gmail.com>
Sun, 5 Jun 2022 08:33:34 +0000 (12:33 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:03 +0000 (14:24 +0200)
commitb794f96671d420cdf7d414d080e84468c5536080
treee750d47b24354ba73bf2bb7401f3f65cd90bdbdf
parent8fd1f157f4b378423b89179d8fd3828b54323d66
remoteproc: k3-r5: Fix refcount leak in k3_r5_cluster_of_init

[ Upstream commit 70ffcfa57211a8a8e58bbba471ac4e5e4c2a44d6 ]

Every iteration of for_each_available_child_of_node() decrements
the reference count of the previous node.
When breaking early from a for_each_available_child_of_node() loop,
we need to explicitly call of_node_put() on the child node.
Add missing of_node_put() to avoid refcount leak.

Fixes: 0cb61aa80327 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Suman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20220605083334.23942-1-linmq006@gmail.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/ti_k3_r5_remoteproc.c