Skip to contentSkip to conversation

drm/sun4i: tcon: Fix refcount leak bug in sun4i_tcon_of_get_id_from_port()

PATCH New Liang He 1 participant 1 message Jul 21, 2022

Subsystems (4)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 drm/sun4i: tcon: Fix refcount leak bug in sun4i_tcon_of_get_id_from_port()

We should call of_node_put() for the reference returned by of_graph_get_remote_endpoint() when it is not used anymore.

Fixes e8d5bbf7f4c4 ("drm/sun4i: tcon: get TCON ID and matching engine with remote endpoint ID")
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/sun4i/sun4i_tcon.c +1 -0
index 523a6d787921..744379baa9da 100644
@@ -972,6 +972,7 @@ static int sun4i_tcon_of_get_id_from_port(struct device_node *port)
 			continue;
 
 		ret = of_property_read_u32(remote, "reg", &reg);
+		of_node_put(remote);
 		if (ret)
 			continue;
 
Signature · 1 line
2.25.1