drm/bridge: sii902x: Fix device node reference leak sii902x_probe
Subsystems (4)
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")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/gpu/drm/bridge/sii902x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/sii902x.c +3 -1
@@ -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)