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)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Sun, 17 Jul 2022 03:15:40 +0000 (22:15 -0500)
of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.

Fixes: 53e2822e56c7 ("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
drivers/rpmsg/qcom_smd.c

index c87413a5bf6c6d24d3fc16f7a9e0d5de7865149f..1044cf03c54222b0c4cd4e1ec8a3b88d63498495 100644 (file)
@@ -1383,6 +1383,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;