Skip to content

Commit

Permalink
rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge
Browse files Browse the repository at this point in the history
of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.

Fixes: 53e2822 ("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
  • Loading branch information
Miaoqian Lin authored and Bjorn Andersson committed Jul 17, 2022
1 parent 101042f commit 6538258
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/rpmsg/qcom_smd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6538258

Please sign in to comment.