]> git.baikalelectronics.ru Git - kernel.git/commitdiff
rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 11 May 2022 12:07:37 +0000 (16:07 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:08 +0000 (14:24 +0200)
[ Upstream commit 2da6bfb2b12cd7c53f7b7bb309e46c53fda97477 ]

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.

Fixes: 6d771081793f ("rpmsg: Introduce Qualcomm SMD backend")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220511120737.57374-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rpmsg/qcom_smd.c

index 370688e8646bff461fe26e9975793cf6eb765a84..c1c07ff39a79615c06d04ce46b2d316c19165803 100644 (file)
@@ -1380,6 +1380,7 @@ static int qcom_smd_parse_edge(struct device *dev,
                }
 
                edge->ipc_regmap = syscon_node_to_regmap(syscon_np);
+               of_node_put(syscon_np);
                if (IS_ERR(edge->ipc_regmap)) {
                        ret = PTR_ERR(edge->ipc_regmap);
                        goto put_node;