drm/amd/display: Fix array-index-out-of-bounds in dcn35_clkmgr
authorRoman Li <roman.li@amd.com>
Tue, 30 Jan 2024 23:07:24 +0000 (18:07 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Feb 2024 22:13:14 +0000 (17:13 -0500)
commita8edc9cc0b14e3769bbc9b82d00e5e5fc6b5ff0a
treea8ab80ca133e9a97dc884d2d3246175e8669ff72
parentbb46122db730f42f3fc1d9d511b3d6ebe8375cdd
drm/amd/display: Fix array-index-out-of-bounds in dcn35_clkmgr

[Why]
There is a potential memory access violation while
iterating through array of dcn35 clks.

[How]
Limit iteration per array size.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@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/clk_mgr/dcn35/dcn35_clk_mgr.c