提交 a8efd588 编写于 作者: T tom will 提交者: Alex Deucher

drm/radeon: fix array out of bounds

When the initial value of i is greater than zero,
it may cause endless loop, resulting in array out
of bounds, fix it.
Signed-off-by: Ntom will <os@iscas.ac.cn>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 e2ed8a13
......@@ -2164,7 +2164,7 @@ static void kv_apply_state_adjust_rules(struct radeon_device *rdev,
if (pi->caps_stable_p_state) {
stable_p_state_sclk = (max_limits->sclk * 75) / 100;
for (i = table->count - 1; i >= 0; i++) {
for (i = table->count - 1; i >= 0; i--) {
if (stable_p_state_sclk >= table->entries[i].clk) {
stable_p_state_sclk = table->entries[i].clk;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部