Skip to content

Commit e2c4c6c

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]>
1 parent 44cea2b commit e2c4c6c

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
@@ -600,8 +600,8 @@ static void CalculateBytePerPixelAndBlockSizes(
600600
{
601601
*BytePerPixelDETY = 0;
602602
*BytePerPixelDETC = 0;
603-
*BytePerPixelY = 0;
604-
*BytePerPixelC = 0;
603+
*BytePerPixelY = 1;
604+
*BytePerPixelC = 1;
605605

606606
if (SourcePixelFormat == dml2_444_64) {
607607
*BytePerPixelDETY = 8;

0 commit comments

Comments
 (0)