drm/amd/display: Fix uninitialized variables in dcn401
authorAlex Hung <alex.hung@amd.com>
Sat, 8 Jun 2024 02:03:31 +0000 (20:03 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2024 21:10:36 +0000 (17:10 -0400)
[WHAT & HOW]
surf_linear_128_l/c are used in CalculateBytePerPixelAndBlockSizes
before they are assigned, so initializing them before passing them into
the function.

This fixes 2 UNINIT issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@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_dcn4_calcs.c

index be73784e21ebc8c46738453819a023fb028cb25c..6f4026e396e098b8418e3a3cd86197176e7aee2e 100644 (file)
@@ -11521,8 +11521,8 @@ void dml2_core_calcs_get_dpte_row_height(
        unsigned int MacroTileWidthC;
        unsigned int MacroTileHeightY;
        unsigned int MacroTileHeightC;
-       bool surf_linear_128_l;
-       bool surf_linear_128_c;
+       bool surf_linear_128_l = false;
+       bool surf_linear_128_c = false;
 
        CalculateBytePerPixelAndBlockSizes(
                SourcePixelFormat,