diff options
author | Alex Hung <alex.hung@amd.com> | 2024-06-07 22:09:53 -0600 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-07-01 16:06:53 -0400 |
commit | bbd0d1c942cbac87404ed2bca0aa4f7907b8f47f (patch) | |
tree | b5d6ff653f2dab7da511791b8ae020b9081dc842 /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | |
parent | 95134e5852978a92d2290a3b1ee93189e75507ac (diff) | |
download | linux-bbd0d1c942cbac87404ed2bca0aa4f7907b8f47f.tar.gz linux-bbd0d1c942cbac87404ed2bca0aa4f7907b8f47f.tar.bz2 linux-bbd0d1c942cbac87404ed2bca0aa4f7907b8f47f.zip |
drm/amd/display: Fix possible overflow in integer multiplication
[WHAT & HOW]
Integer multiplies integer may overflow in context that expects an
expression of unsigned/siged long long (64 bits). This can be fixed
by casting integer to unsigned/siged long long to force 64 bits results.
This fixes 26 OVERFLOW_BEFORE_WIDEN issues reported by Coverity.
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c index 633ab1c16dc6..f40240aafe98 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c @@ -158,7 +158,7 @@ void amdgpu_dm_psr_enable(struct dc_stream_state *stream) DRM_DEBUG_DRIVER("Enabling psr...\n"); vsync_rate_hz = div64_u64(div64_u64(( - stream->timing.pix_clk_100hz * 100), + stream->timing.pix_clk_100hz * (uint64_t)100), stream->timing.v_total), stream->timing.h_total); |