Skip to content

Commit 5396a70

Browse files
Alex Hungalexdeucher
authored andcommitted
drm/amd/display: Check pipe offset before setting vblank
pipe_ctx has a size of MAX_PIPES so checking its index before accessing the array. This fixes an OVERRUN issue reported by Coverity. Reviewed-by: Rodrigo Siqueira <[email protected]> Acked-by: Wayne Lin <[email protected]> Signed-off-by: Alex Hung <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent bd31e50 commit 5396a70

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,12 @@ bool dce110_vblank_set(struct irq_service *irq_service,
211211
info->ext_id);
212212
uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
213213

214-
struct timing_generator *tg =
215-
dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
214+
struct timing_generator *tg;
215+
216+
if (pipe_offset >= MAX_PIPES)
217+
return false;
218+
219+
tg = dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
216220

217221
if (enable) {
218222
if (!tg || !tg->funcs->arm_vert_intr(tg, 2)) {

0 commit comments

Comments
 (0)