Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>
(cherry picked from commit e2c4c6c10542ccfe4a0830bb6c9fd5b177b7bbb7)

authored by

Alex Hung and committed by
Alex Deucher
36b23e3b b5c764d6

+2 -2
+2 -2
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c
··· 579 579 { 580 580 *BytePerPixelDETY = 0; 581 581 *BytePerPixelDETC = 0; 582 - *BytePerPixelY = 0; 583 - *BytePerPixelC = 0; 582 + *BytePerPixelY = 1; 583 + *BytePerPixelC = 1; 584 584 585 585 if (SourcePixelFormat == dml2_444_64) { 586 586 *BytePerPixelDETY = 8;