Skip to content

Commit cdb3a86

Browse files
James Hughespopcornmix
authored andcommitted
Fixup FKMS interrupt handing for non-existent display
If an errant interrupt flag was received from a non-existent display, a NULL pointer access was made. Protect against this by checking if a second display is present prior to checking the interrupt flags.
1 parent eb94c22 commit cdb3a86

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

‎drivers/gpu/drm/vc4/vc4_firmware_kms.c‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,14 +1085,17 @@ static irqreturn_t vc4_crtc_irq_handler(int irq, void *data)
10851085
vc4_crtc_handle_page_flip(crtc_list[0]);
10861086
}
10871087

1088-
/* Check for the secondary display too */
1089-
chan = readl(crtc_list[0]->regs + SMIDSW1);
1088+
if (crtc_list[1]) {
1089+
/* Check for the secondary display too */
1090+
chan = readl(crtc_list[0]->regs + SMIDSW1);
10901091

1091-
if (chan & 1) {
1092-
writel(SMI_NEW, crtc_list[0]->regs + SMIDSW1);
1093-
if (crtc_list[1]->vblank_enabled)
1094-
drm_crtc_handle_vblank(&crtc_list[1]->base);
1095-
vc4_crtc_handle_page_flip(crtc_list[1]);
1092+
if (chan & 1) {
1093+
writel(SMI_NEW, crtc_list[0]->regs + SMIDSW1);
1094+
1095+
if (crtc_list[1]->vblank_enabled)
1096+
drm_crtc_handle_vblank(&crtc_list[1]->base);
1097+
vc4_crtc_handle_page_flip(crtc_list[1]);
1098+
}
10961099
}
10971100
}
10981101

0 commit comments

Comments
 (0)