]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Fix out of bounds access on DNC31 stream encoder regs
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 7 Dec 2021 14:46:39 +0000 (09:46 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 7 Dec 2021 18:12:27 +0000 (13:12 -0500)
commit45675abf593e54c0460bc6aab850a44582e6e5ad
tree30aa79cc61760666d74899e1e2b9fcdcb0991438
parent212db6fafcb46df9afe758fdb65f1ebaf275ff50
drm/amd/display: Fix out of bounds access on DNC31 stream encoder regs

[Why]
During dcn31_stream_encoder_create, if PHYC/D get remapped to F/G on B0
then we'll index 5 or 6 into a array of length 5 - leading to an
access violation on some configs during device creation.

[How]
Software won't be touching PHYF/PHYG directly, so just extend the
array to cover all possible engine IDs.

Even if it does by try to access one of these registers by accident
the offset will be 0 and we'll get a warning during the access.

Fixes: 88e6c8912d4e ("drm/amd/display: Fix DCN3 B0 DP Alt Mapping")
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c