Skip to content

Commit 643ca19

Browse files
author
Laurent Pinchart
committed
drm: rcar-du: lvds: Fix crash in .atomic_check when disabling connector
The connector .atomic_check() handler can be called with a NULL crtc pointer in the connector state when the connector gets disabled explicitly (through performing a legacy mode set or setting the connector's CRTC_ID property to 0). This causes a crash as the crtc pointer is dereferenced without any check. Fix it by returning from the .atomic_check() handler when then crtc pointer is NULL, as there is no check to be performed when the connector gets disabled. Fixes: c6a27fa ("drm: rcar-du: Convert LVDS encoder code to bridge driver") Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
1 parent 60cc43f commit 643ca19

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/rcar-du/rcar_lvds.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector,
8888
const struct drm_display_mode *panel_mode;
8989
struct drm_crtc_state *crtc_state;
9090

91+
if (!state->crtc)
92+
return 0;
93+
9194
if (list_empty(&connector->modes)) {
9295
dev_dbg(lvds->dev, "connector: empty modes list\n");
9396
return -EINVAL;

0 commit comments

Comments
 (0)