From 7c61434be891c1582e72188d2ac230606af5c1c6 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 27 Jan 2022 22:50:24 +0000 Subject: [PATCH] drm/amd/display: Fix out of bounds access on DNC31 stream encoder regs From Nicholas Kazlauskas 89166801f80dc64083212eef1308bfc62f6844f1 in linux 5.15.y/5.15.17 d374d3b493215d637b9e7be12a93f22caf4c1f97 in mainline linux --- sys/dev/pci/drm/amd/display/dc/dcn31/dcn31_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/display/dc/dcn31/dcn31_resource.c b/sys/dev/pci/drm/amd/display/dc/dcn31/dcn31_resource.c index 0fe570717ba..d4fe5352421 100644 --- a/sys/dev/pci/drm/amd/display/dc/dcn31/dcn31_resource.c +++ b/sys/dev/pci/drm/amd/display/dc/dcn31/dcn31_resource.c @@ -470,7 +470,8 @@ static const struct dcn30_afmt_mask afmt_mask = { SE_DCN3_REG_LIST(id)\ } -static const struct dcn10_stream_enc_registers stream_enc_regs[] = { +/* Some encoders won't be initialized here - but they're logical, not physical. */ +static const struct dcn10_stream_enc_registers stream_enc_regs[ENGINE_ID_COUNT] = { stream_enc_regs(0), stream_enc_regs(1), stream_enc_regs(2), -- 2.20.1