Skip to content

Commit 36b23e3

Browse files
Alex Hungalexdeucher
authored andcommitted
drm/amd/display: Initialize denominator defaults to 1
[WHAT & HOW] Variables, used as denominators and maybe not assigned to other values, should be initialized to non-zero to avoid DIVIDE_BY_ZERO, as reported by Coverity. Reviewed-by: Austin Zheng <[email protected]> Reviewed-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Hung <[email protected]> Signed-off-by: Tom Chung <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit e2c4c6c)
1 parent b5c764d commit 36b23e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,8 @@ static void CalculateBytePerPixelAndBlockSizes(
579579
{
580580
*BytePerPixelDETY = 0;
581581
*BytePerPixelDETC = 0;
582-
*BytePerPixelY = 0;
583-
*BytePerPixelC = 0;
582+
*BytePerPixelY = 1;
583+
*BytePerPixelC = 1;
584584

585585
if (SourcePixelFormat == dml2_444_64) {
586586
*BytePerPixelDETY = 8;

0 commit comments

Comments
 (0)