mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 20:59:37 +02:00
drm/amd/display: Check pipe offset before setting vblank
[ Upstream commit 5396a70e8c
]
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 <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9933eca6ad
commit
96bf81cc1b
|
@ -211,8 +211,12 @@ bool dce110_vblank_set(struct irq_service *irq_service,
|
||||||
info->ext_id);
|
info->ext_id);
|
||||||
uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
|
uint8_t pipe_offset = dal_irq_src - IRQ_TYPE_VBLANK;
|
||||||
|
|
||||||
struct timing_generator *tg =
|
struct timing_generator *tg;
|
||||||
dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
|
|
||||||
|
if (pipe_offset >= MAX_PIPES)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
tg = dc->current_state->res_ctx.pipe_ctx[pipe_offset].stream_res.tg;
|
||||||
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if (!tg || !tg->funcs->arm_vert_intr(tg, 2)) {
|
if (!tg || !tg->funcs->arm_vert_intr(tg, 2)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user