Skip to content

Commit c22f2ff

Browse files
jhovoldmripard
authored andcommitted
drm/sun4i: fix missing component unbind on bind errors
Make sure to unbind all subcomponents when binding the aggregate device fails. Fixes: 9026e0d ("drm: Add Allwinner A10 Display Engine support") Cc: [email protected] # 4.7 Cc: Maxime Ripard <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5c8cf16 commit c22f2ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/sun4i/sun4i_drv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ static int sun4i_drv_bind(struct device *dev)
9595
/* drm_vblank_init calls kcalloc, which can fail */
9696
ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
9797
if (ret)
98-
goto cleanup_mode_config;
98+
goto unbind_all;
9999

100100
/* Remove early framebuffers (ie. simplefb) */
101101
ret = drm_aperture_remove_framebuffers(false, &sun4i_drv_driver);
102102
if (ret)
103-
goto cleanup_mode_config;
103+
goto unbind_all;
104104

105105
sun4i_framebuffer_init(drm);
106106

@@ -119,6 +119,8 @@ static int sun4i_drv_bind(struct device *dev)
119119

120120
finish_poll:
121121
drm_kms_helper_poll_fini(drm);
122+
unbind_all:
123+
component_unbind_all(dev, NULL);
122124
cleanup_mode_config:
123125
drm_mode_config_cleanup(drm);
124126
of_reserved_mem_device_release(dev);

0 commit comments

Comments
 (0)