Files
linux/drivers/gpu/drm/radeon
Nikita Zhandarovich 8379b4ae63 drm/radeon: fix possible division-by-zero errors
[ Upstream commit 1becc57cd1 ]

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: 66229b2005 ("drm/radeon/kms: add dpm support for rv7xx (v4)")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-11 19:39:40 +02:00
..
2022-04-25 11:17:45 +02:00
2019-12-18 16:09:13 -05:00
2019-06-10 22:30:24 +02:00
2022-01-18 17:43:36 -05:00
2019-06-10 22:30:24 +02:00
2022-08-23 16:53:43 -04:00
2022-01-18 17:43:36 -05:00
2022-01-18 17:43:36 -05:00
2019-06-10 22:30:24 +02:00
2022-01-18 17:43:36 -05:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00