]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amd/display: prevent potential division by zero errors
authorHamza Mahfooz <hamza.mahfooz@amd.com>
Tue, 5 Sep 2023 17:27:22 +0000 (13:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Sep 2023 02:10:11 +0000 (22:10 -0400)
commit07e388aab042774f284a2ad75a70a194517cdad4
tree9df91f1465923d1ecb73336cc997741a776871be
parent57a943ebfcdb4a97fbb409640234bdb44bfa1953
drm/amd/display: prevent potential division by zero errors

There are two places in apply_below_the_range() where it's possible for
a divide by zero error to occur. So, to fix this make sure the divisor
is non-zero before attempting the computation in both cases.

Cc: stable@vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637
Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math")
Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/freesync/freesync.c