]> www.infradead.org Git - users/dwmw2/linux.git/commit
drm/amd/display: Limit array index according to architecture
authorAlex Hung <alex.hung@amd.com>
Fri, 26 Apr 2024 00:37:58 +0000 (18:37 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 2 May 2024 20:18:18 +0000 (16:18 -0400)
commit55ec7679e6a5f67d2831b87a24fe2d5066311fdd
treeacbe6589eb00d38404a0810b24c9485f4da4d3b9
parentae13c8a5cff92015b9a3eb7cee65ebc75859487f
drm/amd/display: Limit array index according to architecture

[WHY & HOW]
ctx->architecture determine array sizes of ODMMode and DPPPerSurface
arrays to __DML2_WRAPPER_MAX_STREAMS_PLANES__ or __DML_NUM_PLANES__,
and these array index should be checked before used

This fixes 2 OVERRUN issues reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Alex Hung <alex.hung@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_dc_resource_mgmt.c