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 <austin.zheng@amd.com> Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
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)