drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
Subsystems (3)
PATCH 1/1 drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
The probe path calls drm_panel_add() before mipi_dsi_attach().
If mipi_dsi_attach() fails, the driver returns without calling
drm_panel_remove(), leaving the panel registered in the global DRM panel list. The driver's .remove() callback does not handle this case because failed probe does not transition through the normal bound-device removal path.
Fix this by unwinding drm_panel_add() when mipi_dsi_attach() fails.
--- drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c +1 -0
@@ -205,6 +205,7 @@ static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi) ret =mipi_dsi_attach (dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret); +drm_panel_remove (&ctx->panel);return ret; }
Signature · 1 line
2.47.1
Quoted 18 lines · Myeonghun Pak
The probe path calls
drm_panel_add()beforemipi_dsi_attach().If
mipi_dsi_attach()fails, the driver returns without calling
drm_panel_remove(), leaving the panel registered in the global DRM panel list. The driver's .remove() callback does not handle this case because failed probe does not transition through the normal bound-device removal path.Fix this by unwinding
drm_panel_add()whenmipi_dsi_attach()fails.Co-developed-by Ijae Kim <[email protected]>Signed-off-by Ijae Kim <[email protected]>Co-developed-by Taegyu Kim <[email protected]>Signed-off-by Taegyu Kim <[email protected]>Co-developed-by Yuho Choi <[email protected]>Signed-off-by Yuho Choi <[email protected]>Signed-off-by Myeonghun Pak <[email protected]>
Quoted 4 lines
--- drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 1 + 1 file changed, 1 insertion(+)
Please group similar pathces in a single series. There is devm_drm_panel_add() in drm-misc-next.
Signature · 2 lines
With best wishes Dmitry
Dmitry,
Thank you for the review.
As you pointed out, I will group the similar patches into a single series for submission.
I also agree that using devm_drm_panel_add() is a better approach for cleaning up the code. I will re-work the next version to apply this managed resource API.
Thanks,
Myeonghun Pak
2026년 4월 23일 (목) 오전 4:25, Dmitry Baryshkov <
[email protected]>님이 작성:
Quoted 31 lines · Myeonghun Pak
Quoted 18 lines
The probe path calls
drm_panel_add()beforemipi_dsi_attach().If
mipi_dsi_attach()fails, the driver returns without calling
drm_panel_remove(), leaving the panel registered in the global DRM panel list. The driver's .remove() callback does not handle this case because failed probe does not transition through the normal bound-device removal path.Fix this by unwinding
drm_panel_add()whenmipi_dsi_attach()fails.Co-developed-by Ijae Kim <[email protected]>Signed-off-by Ijae Kim <[email protected]>Co-developed-by Taegyu Kim <[email protected]>Signed-off-by Taegyu Kim <[email protected]>Co-developed-by Yuho Choi <[email protected]>Signed-off-by Yuho Choi <[email protected]>Signed-off-by Myeonghun Pak <[email protected]>Quoted 4 lines
--- drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 1 + 1 file changed, 1 insertion(+)Please group similar pathces in a single series. There is
devm_drm_panel_add()in drm-misc-next.--
With best wishes
Dmitry