提交 c07aefc2 编写于 作者: R Rex Zhu 提交者: Alex Deucher

drm/amd/powerplay: fix potential issue of array access violation

Signed-off-by: NRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 9716ebc3
......@@ -388,12 +388,9 @@ int phm_reset_single_dpm_table(void *table,
struct vi_dpm_table *dpm_table = (struct vi_dpm_table *)table;
PP_ASSERT_WITH_CODE(count <= max,
"Fatal error, can not set up single DPM table entries to exceed max number!",
);
dpm_table->count = count > max ? max : count;
dpm_table->count = count;
for (i = 0; i < max; i++)
for (i = 0; i < dpm_table->count; i++)
dpm_table->dpm_level[i].enabled = false;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册