Skip to content

Commit 80579bf

Browse files
smaeulmripard
authored andcommitted
drm/sun4i: dsi: Avoid hotplug race with DRM driver bind
We need to make sure that the DRM driver is fully registered before allowing the panel to be attached. Otherwise, we may trigger a hotplug event before sun4i_framebuffer_init() sets up drm->mode_config.funcs, causing a NULL pointer dereference. Fixes: 1a2703b ("drm/sun4i: dsi: Allow binding the host without a panel") Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 91ea833 commit 80579bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,
970970

971971
if (IS_ERR(panel))
972972
return PTR_ERR(panel);
973-
if (!dsi->drm)
973+
if (!dsi->drm || !dsi->drm->registered)
974974
return -EPROBE_DEFER;
975975

976976
dsi->panel = panel;

0 commit comments

Comments
 (0)