Skip to contentSkip to conversation

drm/bridge: sii902x: Fix device node reference leak sii902x_probe

PATCH New Miaoqian Lin 1 participant 1 message Oct 29, 2025

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

PATCH 1/1 drm/bridge: sii902x: Fix device node reference leak sii902x_probe

of_graph_get_endpoint_by_regs() gets a reference to the endpoint node to read the "bus-width" property but fails to call of_node_put() to release the reference, causing a reference count leak.

Add the missing of_node_put() call to fix this.

Found via static analysis and code review.

Fixes d284ccd8588c ("drm/bridge: sii902x: Set input bus format based on bus-width")
---
 drivers/gpu/drm/bridge/sii902x.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/sii902x.c +3 -1
index d537b1d036fb..3a247ac3c7dd 100644
@@ -1189,8 +1189,10 @@ static int sii902x_probe(struct i2c_client *client)
 
 	sii902x->bus_width = 24;
 	endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
-	if (endpoint)
+	if (endpoint) {
 		of_property_read_u32(endpoint, "bus-width", &sii902x->bus_width);
+		of_node_put(endpoint);
+	}
 
 	endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 1, -1);
 	if (endpoint) {
Signature · 1 line
2.39.5 (Apple Git-154)