lt9611uxc_parse_dt() stores remote DSI node references for the attach
step, and the probe error path releases them after parse_dt() succeeds.
When the next bridge lookup fails, parse_dt() returns before probe can
reach err_of_put. That leaks the DSI node references, including the
common -EPROBE_DEFER path while the next bridge is not ready.
Release the acquired DSI nodes before returning the lookup error from
parse_dt().
Fixes: 7c5537cee9a8 ("drm/bridge: lt9611uxc: properly attach to a next bridge")
Signed-off-by: Zhiqi Zhang <[email protected]>
---
AI assistance disclosure: I found the bug. Codex modified the code.
I reviewed the change.
Build-tested with ARCH=arm64 allmodconfig object builds.
I did not test on hardware.
drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index b3bb7f2ceb..5bf2bcec43 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -490,8 +490,11 @@ static int lt9611uxc_parse_dt(struct device *dev,
lt9611uxc->dsi1_node = of_graph_get_remote_node(dev->of_node, 1, -1);
lt9611uxc->bridge.next_bridge =
of_drm_get_bridge_by_endpoint(dev->of_node, 2, -1);
- if (IS_ERR(lt9611uxc->bridge.next_bridge))
+ if (IS_ERR(lt9611uxc->bridge.next_bridge)) {
+ of_node_put(lt9611uxc->dsi1_node);
+ of_node_put(lt9611uxc->dsi0_node);
return PTR_ERR(lt9611uxc->bridge.next_bridge);
+ }
return 0;
}
--
2.54.0 (Apple Git-157)