rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge

[ Upstream commit 65382585f0 ]

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

Fixes: 53e2822e56 ("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>
This commit is contained in:
Miaoqian Lin 2022-05-11 16:07:37 +04:00 committed by Greg Kroah-Hartman
parent 5a2515b4b6
commit ae7fdbab97
1 changed files with 1 additions and 0 deletions

View 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;