diff options
author | tom will <os@iscas.ac.cn> | 2016-05-16 00:58:11 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-16 10:25:13 -0400 |
commit | a8efd58815a8d8bdca409a4b8319281cd9c24f7f (patch) | |
tree | 07d87940890b71b4c46808562b053d75de00ce8c /drivers/gpu/drm/radeon | |
parent | e2ed8a132a70dc61ef6d9979bec4f37a3abbba4b (diff) |
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: tom will <os@iscas.ac.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/kv_dpm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index d0240743a17c..a7e978677937 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c | |||
@@ -2164,7 +2164,7 @@ static void kv_apply_state_adjust_rules(struct radeon_device *rdev, | |||
2164 | if (pi->caps_stable_p_state) { | 2164 | if (pi->caps_stable_p_state) { |
2165 | stable_p_state_sclk = (max_limits->sclk * 75) / 100; | 2165 | stable_p_state_sclk = (max_limits->sclk * 75) / 100; |
2166 | 2166 | ||
2167 | for (i = table->count - 1; i >= 0; i++) { | 2167 | for (i = table->count - 1; i >= 0; i--) { |
2168 | if (stable_p_state_sclk >= table->entries[i].clk) { | 2168 | if (stable_p_state_sclk >= table->entries[i].clk) { |
2169 | stable_p_state_sclk = table->entries[i].clk; | 2169 | stable_p_state_sclk = table->entries[i].clk; |
2170 | break; | 2170 | break; |