drm/amd/display: Add hpd_source index check for DCE60/80/100/110/112/120 link encoders
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Thu, 17 Oct 2024 01:58:45 +0000 (07:28 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 22 Oct 2024 21:50:37 +0000 (17:50 -0400)
commit7c8fb3b8e9ba7e1aeb98a96640d62adc44809383
tree1c54f06111cc44ae5b23104ad45aa8341e22c306
parent785504dd7fa108c15d87278fa426d55086c8babf
drm/amd/display: Add hpd_source index check for DCE60/80/100/110/112/120 link encoders

This patch adds a boundary check for the hpd_source index during the
link encoder creation process for all DCExxx IP's. The check ensures
that the index is within the valid range of the link_enc_hpd_regs array
to prevent out-of-bounds access.

Cc: Tom Chung <chiahsuan.chung@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Roman Li <roman.li@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce60/dce60_resource.c
drivers/gpu/drm/amd/display/dc/resource/dce100/dce100_resource.c
drivers/gpu/drm/amd/display/dc/resource/dce110/dce110_resource.c
drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c
drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c
drivers/gpu/drm/amd/display/dc/resource/dce80/dce80_resource.c