* [PATCH] drm/bridge: chipone-icn6211: remove bridge when chipone_dsi_host_attach fails
@ 2026-04-10 19:55 Osama Abdelkader
2026-04-11 23:26 ` Claude review: " Claude Code Review Bot
2026-04-11 23:26 ` Claude Code Review Bot
0 siblings, 2 replies; 3+ messages in thread
From: Osama Abdelkader @ 2026-04-10 19:55 UTC (permalink / raw)
To: luca.ceresoli, Jagan Teki, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, dri-devel, linux-kernel
Cc: Osama Abdelkader
when chipone_dsi_host_attach fails in chipone_i2c_probe remove drm
bridge before return
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
drivers/gpu/drm/bridge/chipone-icn6211.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c
index 814713c5bea9..5bee10c64265 100644
--- a/drivers/gpu/drm/bridge/chipone-icn6211.c
+++ b/drivers/gpu/drm/bridge/chipone-icn6211.c
@@ -760,7 +760,10 @@ static int chipone_i2c_probe(struct i2c_client *client)
drm_bridge_add(&icn->bridge);
- return chipone_dsi_host_attach(icn);
+ ret = chipone_dsi_host_attach(icn);
+ if (ret)
+ drm_bridge_remove(&icn->bridge);
+ return ret;
}
static void chipone_dsi_remove(struct mipi_dsi_device *dsi)
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Claude review: drm/bridge: chipone-icn6211: remove bridge when chipone_dsi_host_attach fails
2026-04-10 19:55 [PATCH] drm/bridge: chipone-icn6211: remove bridge when chipone_dsi_host_attach fails Osama Abdelkader
@ 2026-04-11 23:26 ` Claude Code Review Bot
2026-04-11 23:26 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-11 23:26 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/bridge: chipone-icn6211: remove bridge when chipone_dsi_host_attach fails
Author: Osama Abdelkader <osama.abdelkader@gmail.com>
Patches: 1
Reviewed: 2026-04-12T09:26:10.914700
---
This is a single, straightforward bugfix patch that addresses a resource leak in the `chipone_i2c_probe()` error path. When `chipone_dsi_host_attach()` fails, the bridge added via `drm_bridge_add()` was not being cleaned up, leaving a stale bridge registered. The fix correctly mirrors the pattern already used in the sibling `chipone_dsi_probe()` function.
The fix is correct and minimal. One minor style nit exists.
**Verdict: Patch looks good with a minor nit.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Claude review: drm/bridge: chipone-icn6211: remove bridge when chipone_dsi_host_attach fails
2026-04-10 19:55 [PATCH] drm/bridge: chipone-icn6211: remove bridge when chipone_dsi_host_attach fails Osama Abdelkader
2026-04-11 23:26 ` Claude review: " Claude Code Review Bot
@ 2026-04-11 23:26 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-11 23:26 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness: Good.** The fix is correct. Looking at the existing code, `chipone_dsi_probe()` (line 713) already handles the equivalent error path for the DSI probe:
```c
ret = chipone_dsi_attach(icn);
if (ret)
drm_bridge_remove(&icn->bridge);
return ret;
```
The `chipone_i2c_probe()` function was missing the same cleanup pattern. The patch correctly adds `drm_bridge_remove()` on the `chipone_dsi_host_attach()` failure path, making the two probe functions consistent.
**Style nit:** The commit message subject line is fine, but the body could be improved. It currently reads:
> when chipone_dsi_host_attach fails in chipone_i2c_probe remove drm
> bridge before return
This lacks proper capitalization and punctuation. A better version would be:
> When chipone_dsi_host_attach() fails in chipone_i2c_probe(), the
> bridge added by drm_bridge_add() is not removed, leaving a stale
> bridge registered. Add the missing drm_bridge_remove() call to the
> error path.
Also, adding a `Fixes:` tag referencing the commit that introduced `chipone_i2c_probe()` would be appropriate for a bugfix like this, as it helps with stable backporting.
**Code style nit:** There should be a blank line before `return ret;` to separate the error-handling block from the return, matching the style in `chipone_dsi_probe()` (line 739):
```c
ret = chipone_dsi_host_attach(icn);
if (ret)
drm_bridge_remove(&icn->bridge);
+
return ret;
```
**Overall: The fix is correct and should be accepted, ideally with the commit message improvements and `Fixes:` tag added.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-11 23:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 19:55 [PATCH] drm/bridge: chipone-icn6211: remove bridge when chipone_dsi_host_attach fails Osama Abdelkader
2026-04-11 23:26 ` Claude review: " Claude Code Review Bot
2026-04-11 23:26 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox