soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 6 Jun 2022 06:42:52 +0000 (10:42 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:10 +0000 (14:23 +0200)
commit053543ac1d095132fcfd1263805d6e25afbdc6a8
treeb5c9edc992a2d25fa7c88bc98a0b0ef7c9d5a5ab
parent84a928b44cb303d5756e3bff2734921de8dce4f6
soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register

[ Upstream commit e6e0951414a314e7db3e9e24fd924b3e15515288 ]

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: 05589b30b21a ("soc: qcom: Extend AOSS QMP driver to support resources that are used to wake up the SoC.")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220606064252.42595-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/qcom/qcom_aoss.c