]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 1 Jul 2022 03:03:58 +0000 (22:03 -0500)
commit8353eae097b8b59f016f2882987efd1f1ca7560a
treec20ddbfd031250bfdb157726f7f5e68eca093fa0
parent627e732db7f4d18f16f731e5ae43eeb2d24b5b76
soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register

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: aae5cf3a96d0 ("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
drivers/soc/qcom/qcom_aoss.c