]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/pm: vega10_hwmgr: fix potential off-by-one overflow in 'performance_levels'
authorAlexey Kodanev <aleksei.kodanev@bell-sw.com>
Tue, 4 Oct 2022 08:14:01 +0000 (11:14 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 10 Oct 2022 21:32:56 +0000 (17:32 -0400)
commite8bfb5dbc0b725acacc10a208bb4376a3405a63f
tree9247619973ef4714b7617bd7e800e4b1e3bcf9a2
parentbc14a47cb8b7842c9cae8af5a7ba21904b34fe62
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: 554a4f5e24df ("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>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c