Skip to content

Commit

Permalink
drm/vc4: Fix potential null pointer read when disabling vblank
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
6by9 authored and popcornmix committed May 13, 2024
1 parent 7b421a8 commit 4ac81ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vc4/vc4_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ static void vc4_disable_vblank(struct drm_crtc *crtc)
if (!drm_dev_enter(dev, &idx))
return;

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

drm_dev_exit(idx);
Expand Down

0 comments on commit 4ac81ba

Please sign in to comment.