Skip to content

Commit 8f01e2d

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 05c04ab commit 8f01e2d

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
@@ -1087,14 +1087,17 @@ static irqreturn_t vc4_crtc_irq_handler(int irq, void *data)
10871087
vc4_crtc_handle_page_flip(crtc_list[0]);
10881088
}
10891089

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

1093-
if (chan & 1) {
1094-
writel(SMI_NEW, crtc_list[0]->regs + SMIDSW1);
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]);
1094+
if (chan & 1) {
1095+
writel(SMI_NEW, crtc_list[0]->regs + SMIDSW1);
1096+
1097+
if (crtc_list[1]->vblank_enabled)
1098+
drm_crtc_handle_vblank(&crtc_list[1]->base);
1099+
vc4_crtc_handle_page_flip(crtc_list[1]);
1100+
}
10981101
}
10991102
}
11001103

0 commit comments

Comments
 (0)