Skip to content

Commit 1e53604

Browse files
6by9pelwell
authored andcommitted
drm/vc4: Fix potential null pointer read when disabling vblank
vc4_disable_vblank assumed that vc4_encoder was always assigned, which isn't guaranteed. If it isn't assigned then disable the interrupt anyway as it's not connected. #6146 Fixes: 63c0bcc ("drm/vc4: Add option to call from crtc to encoder on vblank") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent c10f023 commit 1e53604

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/vc4/vc4_crtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static void vc4_disable_vblank(struct drm_crtc *crtc)
834834
if (!drm_dev_enter(dev, &idx))
835835
return;
836836

837-
if (vc4_encoder->type != VC4_ENCODER_TYPE_DSI0)
837+
if (!vc4_encoder || vc4_encoder->type != VC4_ENCODER_TYPE_DSI0)
838838
CRTC_WRITE(PV_INTEN, 0);
839839

840840
drm_dev_exit(idx);

0 commit comments

Comments
 (0)