]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Increase array size of dummy_boolean
authorAlex Hung <alex.hung@amd.com>
Wed, 3 Jul 2024 16:50:35 +0000 (10:50 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:07:12 +0000 (17:07 -0400)
[WHY]
dml2_core_shared_mode_support and dml_core_mode_support access the third
element of dummy_boolean, i.e. hw_debug5 = &s->dummy_boolean[2], when
dummy_boolean has size of 2. Any assignment to hw_debug5 causes an
OVERRUN.

[HOW]
Increase dummy_boolean's array size to 3.

This fixes 2 OVERRUN issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@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/dml21/src/dml2_core/dml2_core_shared_types.h

index 02498c0e32825f56ca8b05fdd867c932cdd8c777..317008eff61b5b615ac3a54ac1b7dad677788f14 100644 (file)
@@ -866,7 +866,7 @@ struct dml2_core_calcs_mode_support_locals {
        unsigned int dpte_row_bytes_per_row_l[DML2_MAX_PLANES];
        unsigned int dpte_row_bytes_per_row_c[DML2_MAX_PLANES];
 
-       bool dummy_boolean[2];
+       bool dummy_boolean[3];
        unsigned int dummy_integer[3];
        unsigned int dummy_integer_array[36][DML2_MAX_PLANES];
        enum dml2_odm_mode dummy_odm_mode[DML2_MAX_PLANES];