mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
drm/amd/pm: vega10_hwmgr: fix potential off-by-one overflow in 'performance_levels'
Since 'hardwareActivityPerformanceLevels' is set to the size of the 'performance_levels' array in vega10_hwmgr_backend_init(), using the '<=' assertion to check for the next index value is incorrect. Replace it with '<'. Detected using the static analysis tool - Svace. Fixes: f83a9991648b ("drm/amd/powerplay: add Vega10 powerplay support (v5)") Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a98cec220a
commit
2cc4a5914c
@ -3155,7 +3155,7 @@ static int vega10_get_pp_table_entry_callback_func(struct pp_hwmgr *hwmgr,
|
||||
return -1);
|
||||
|
||||
PP_ASSERT_WITH_CODE(
|
||||
(vega10_ps->performance_level_count <=
|
||||
(vega10_ps->performance_level_count <
|
||||
hwmgr->platform_descriptor.
|
||||
hardwareActivityPerformanceLevels),
|
||||
"Performance levels exceeds Driver limit!",
|
||||
|
Loading…
x
Reference in New Issue
Block a user