1 From 1e53604087930e7cf42eee3d42572d0d6f54c86a Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 7 May 2024 11:44:49 +0100
4 Subject: [PATCH 1084/1085] drm/vc4: Fix potential null pointer read when
7 vc4_disable_vblank assumed that vc4_encoder was always assigned,
8 which isn't guaranteed.
10 If it isn't assigned then disable the interrupt anyway as it's
13 https://github.com/raspberrypi/linux/issues/6146
15 Fixes: 63c0bcc4b747 ("drm/vc4: Add option to call from crtc to encoder on vblank")
16 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
18 drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
21 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
22 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
23 @@ -834,7 +834,7 @@ static void vc4_disable_vblank(struct dr
24 if (!drm_dev_enter(dev, &idx))
27 - if (vc4_encoder->type != VC4_ENCODER_TYPE_DSI0)
28 + if (!vc4_encoder || vc4_encoder->type != VC4_ENCODER_TYPE_DSI0)
29 CRTC_WRITE(PV_INTEN, 0);