]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport
authorRoman Li <Roman.Li@amd.com>
Wed, 26 Jun 2024 18:08:41 +0000 (14:08 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 1 Jul 2024 20:10:35 +0000 (16:10 -0400)
commit9ef37ff38d01a616a670019330190ce1817df887
tree993112b920950d967eac8e6147802e1f07dca373
parent882643a95fe60c23a70917f97ac0781e92c583dc
drm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport

[Why]
Potential out of bounds access in dml2_calculate_rq_and_dlg_params()
because the value of out_lowest_state_idx used as an index for FCLKChangeSupport
array can be greater than 1.

[How]
Currently dml2 core specifies identical values for all FCLKChangeSupport
elements. Always use index 0 in the condition to avoid out of bounds access.

Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c