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-06-21 17:54:53 -04:00
2022-02-07 13:04:25 -08:00
2020-11-16 15:56:34 -05:00
2023-01-18 09:25:31 +01:00
2022-04-25 11:17:45 +02:00
2023-03-01 22:37:25 -05:00
2019-12-18 16:09:13 -05:00
2022-12-15 12:18:19 -05:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2022-04-11 13:50:35 -04:00
2023-07-11 19:39:32 +02:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2022-04-26 11:43:51 -04:00
2017-12-20 12:00:22 -05:00
2020-11-16 15:56:35 -05:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:35 -05:00
2017-10-30 14:16:21 +01:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2023-07-11 19:39:40 +02:00
2019-06-10 22:30:24 +02:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00
2022-04-19 13:58:32 -04:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2016-04-27 12:27:08 -04:00
2022-06-20 23:53:55 +03:00
2021-05-25 23:47:24 -04:00
2016-08-24 16:25:05 -04:00
2023-01-10 11:15:44 +01:00
2020-11-13 00:11:53 -05:00
2019-06-10 22:30:24 +02:00
2022-08-23 16:53:43 -04:00
2018-10-15 16:16:12 -05:00
2020-11-16 15:56:34 -05:00
2023-07-11 19:39:40 +02:00
2020-11-16 15:56:34 -05:00
2016-04-06 14:57:46 -04:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:34 -05:00
2016-08-24 16:25:05 -04:00
2021-05-13 10:45:15 -04:00
2019-06-10 22:30:24 +02:00
2022-06-20 23:53:55 +03:00
2019-12-03 16:26:59 -05:00
2022-06-23 17:21:49 -04:00
2023-01-18 09:25:31 +01:00
2021-06-22 16:51:45 -04:00
2021-06-22 16:51:45 -04:00
2022-09-13 14:52:14 -04:00
2020-11-16 15:56:34 -05:00
2021-09-23 15:17:28 -04:00
2019-06-10 22:30:24 +02:00
2020-11-16 15:56:35 -05:00
2018-08-27 11:10:19 -05:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:35 -05:00
2016-08-24 16:25:04 -04:00
2023-01-13 13:13:57 +01:00
2017-08-15 14:46:07 -04:00
2021-05-10 15:46:50 +02:00
2023-01-18 09:25:31 +01:00
2021-05-25 23:47:30 -04:00
2022-11-04 16:05:53 -04:00
2020-11-16 15:56:34 -05:00
2019-05-30 11:29:21 -07:00
2022-11-10 15:29:00 -05:00
2020-11-16 15:56:33 -05:00
2019-08-13 09:09:30 +02:00
2022-11-29 11:03:38 -05:00
2019-12-05 08:44:28 +01:00
2021-01-06 15:43:46 +01:00
2023-01-18 09:25:31 +01:00
2022-10-27 11:42:58 +02:00
2020-05-19 22:31:34 +01:00
2023-01-16 15:04:13 +10:00
2020-11-16 15:56:33 -05:00
2023-01-18 09:25:31 +01:00
2023-01-18 10:00:03 +01:00
2023-01-18 09:25:31 +01:00
2020-11-13 00:03:49 -05:00
2023-01-18 09:25:31 +01:00
2023-02-21 13:26:18 +01:00
2021-09-14 09:25:30 +02:00
2021-05-19 22:32:24 -04:00
2023-06-28 11:14:23 +02:00
2021-01-06 15:43:46 +01:00
2021-02-18 16:43:10 -05:00
2023-05-30 14:17:23 +01:00
2022-02-15 17:51:09 +01:00
2021-08-10 20:13:49 +02:00
2023-01-18 09:25:31 +01:00
2023-01-18 09:25:31 +01:00
2020-11-16 15:56:33 -05:00
2023-01-18 09:25:31 +01:00
2022-04-07 12:53:54 +02:00
2023-01-18 09:25:31 +01:00
2022-10-27 11:42:58 +02:00
2022-02-15 17:51:09 +01:00
2022-12-06 10:28:12 +01:00
2020-11-16 15:56:33 -05:00
2022-12-06 12:54:14 +01:00
2020-11-16 15:56:35 -05:00
2021-02-18 16:43:10 -05:00
2022-06-08 11:41:09 -04:00
2019-06-10 22:30:24 +02:00
2022-05-03 16:08:48 +10:00
2019-08-06 08:21:54 +02:00
2019-06-10 22:30:24 +02:00
2022-10-27 11:42:58 +02:00
2023-01-25 17:27:51 +01:00
2021-05-26 20:56:29 +02:00
2019-06-10 22:30:24 +02:00
2022-04-07 12:53:54 +02:00
2021-12-14 16:11:02 -05:00
2022-04-06 17:38:25 +02:00
2022-12-06 12:54:14 +01:00
2021-06-22 16:51:45 -04:00
2022-06-20 23:53:55 +03:00
2021-06-22 16:51:45 -04:00
2021-01-06 15:43:46 +01:00
2019-06-10 22:30:24 +02:00
2021-06-22 16:51:45 -04:00
2020-11-16 15:56:34 -05:00
2023-07-11 19:39:40 +02:00
2019-08-13 09:09:30 +02:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2022-06-20 23:53:55 +03:00
2020-11-16 15:56:34 -05:00
2016-08-24 16:25:05 -04:00
2022-04-06 10:20:25 -04:00
2020-11-16 15:56:34 -05:00
2022-04-26 11:43:57 -04:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:35 -05:00
2016-10-12 15:44:15 -04:00
2021-05-13 10:45:29 -04:00
2020-10-27 17:43:42 -04:00
2020-11-13 00:12:30 -05:00
2020-11-13 00:12:30 -05:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2019-06-10 22:30:24 +02:00
2020-09-22 17:37:38 -04:00
2021-02-18 16:43:09 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00