mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
drm/amd/display: avoid divided by zero
[why] insert divided by zero protection Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Charlene Liu <Charlene.Liu@amd.com> Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
d29bd94c4f
commit
d1fd30e511
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user