aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
diff options
context:
space:
mode:
authorNikita Zhandarovich <[email protected]>2023-05-19 15:33:27 +0000
committerAlex Deucher <[email protected]>2023-06-09 14:44:47 +0000
commit1becc57cd1a905e2aa0e1eca60d2a37744525c4a (patch)
tree0825c8f0fed3d269bd12b70890da51b2d36fddc9 /drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
parentdrm/radeon: stop including swiotlb.h (diff)
downloadkernel-1becc57cd1a905e2aa0e1eca60d2a37744525c4a.tar.gz
kernel-1becc57cd1a905e2aa0e1eca60d2a37744525c4a.zip
drm/radeon: fix possible division-by-zero errors
Function rv740_get_decoded_reference_divider() may return 0 due to unpredictable reference divider value calculated in radeon_atom_get_clock_dividers(). This will lead to division-by-zero error once that value is used as a divider in calculating 'clk_s'. While unlikely, this issue should nonetheless be prevented so add a sanity check for such cases by testing 'decoded_ref' value against 0. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. v2: minor coding style fixes (Alex) In practice this should actually happen as the vbios should be properly populated. Fixes: 66229b200598 ("drm/radeon/kms: add dpm support for rv7xx (v4)") Signed-off-by: Nikita Zhandarovich <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c')
0 files changed, 0 insertions, 0 deletions