Skip to contentSkip to conversation

drm/sun4i: fix missing component unbind on bind errors

PATCH Applied Johan Hovold 2 participants 2 messages Mar 6, 2023 – Mar 7, 2023

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

PATCH 1/1 drm/sun4i: fix missing component unbind on bind errors

Make sure to unbind all subcomponents when binding the aggregate device fails.

Fixes 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
Cc Maxime Ripard <[email protected]>

---

Note that this one has only been compile tested.

Johan

 drivers/gpu/drm/sun4i/sun4i_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +4 -2
index cc94efbbf2d4..d6c741716167 100644
@@ -95,12 +95,12 @@ static int sun4i_drv_bind(struct device *dev)
 	/* drm_vblank_init calls kcalloc, which can fail */
 	ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
 	if (ret)
-		goto cleanup_mode_config;
+		goto unbind_all;
 
 	/* Remove early framebuffers (ie. simplefb) */
 	ret = drm_aperture_remove_framebuffers(false, &sun4i_drv_driver);
 	if (ret)
-		goto cleanup_mode_config;
+		goto unbind_all;
 
 	sun4i_framebuffer_init(drm);
 
@@ -119,6 +119,8 @@ static int sun4i_drv_bind(struct device *dev)
 
 finish_poll:
 	drm_kms_helper_poll_fini(drm);
+unbind_all:
+	component_unbind_all(dev, NULL);
 cleanup_mode_config:
 	drm_mode_config_cleanup(drm);
 	of_reserved_mem_device_release(dev);
Signature · 1 line
2.39.2
#1 lore raw

Re: (subset) [PATCH] drm/sun4i: fix missing component unbind on bind errors

Quoted 4 lines · Johan Hovold

Make sure to unbind all subcomponents when binding the aggregate device fails.

Applied to drm/drm-misc (drm-misc-fixes).

Thanks!
Maxime