diff mbox series

rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge

Message ID 20220511120737.57374-1-linmq006@gmail.com (mailing list archive)
State Accepted
Headers show
Series rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge | expand

Commit Message

Miaoqian Lin May 11, 2022, 12:07 p.m. UTC
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>
---
 drivers/rpmsg/qcom_smd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bjorn Andersson July 18, 2022, 10:59 p.m. UTC | #1
On Wed, 11 May 2022 16:07:37 +0400, Miaoqian Lin wrote:
> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when done.
> 
> 

Applied, thanks!

[1/1] rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge
      commit: 65382585f067d4256ba087934f30f85c9b6984de

Best regards,
diff mbox series

Patch

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 764c980507be..e559c8e468e3 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -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;