]> Git Repo - linux.git/commitdiff
drm/amd/display: avoid divided by zero
authorCharlene Liu <[email protected]>
Tue, 22 Oct 2024 22:42:56 +0000 (18:42 -0400)
committerAlex Deucher <[email protected]>
Mon, 4 Nov 2024 16:33:40 +0000 (11:33 -0500)
[why]
insert divided by zero protection

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Charlene Liu <[email protected]>
Signed-off-by: Zaeem Mohamed <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/display/modules/freesync/freesync.c

index fc4268729017e27e29bb2745ebec53bc4d590117..f980a84dceefce82f36c5c3f1a729a3188fc9873 100644 (file)
@@ -129,6 +129,9 @@ unsigned int mod_freesync_calc_v_total_from_refresh(
        unsigned int v_total;
        unsigned int frame_duration_in_ns;
 
+       if (refresh_in_uhz == 0)
+               return stream->timing.v_total;
+
        frame_duration_in_ns =
                        ((unsigned int)(div64_u64((1000000000ULL * 1000000),
                                        refresh_in_uhz)));
This page took 0.056765 seconds and 4 git commands to generate.