Skip to contentSkip to conversation

rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge

PATCH Applied Miaoqian Lin 2 participants 2 messages May 11, 2022 – Jul 18, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge

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")
---
 drivers/rpmsg/qcom_smd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rpmsg/qcom_smd.c +1 -0
index 764c980507be..e559c8e468e3 100644
@@ -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;
Signature · 1 line
2.25.1
#1 lore raw

Re: (subset) [PATCH] rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge

Quoted 4 lines · Miaoqian Lin

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,

Signature · 1 line
Bjorn Andersson <[email protected]>