diff options
author | tom will <os@iscas.ac.cn> | 2016-05-15 21:58:11 -0700 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-16 10:25:13 -0400 |
commit | a8efd58815a8d8bdca409a4b8319281cd9c24f7f (patch) | |
tree | 07d87940890b71b4c46808562b053d75de00ce8c /drivers | |
parent | e2ed8a132a70dc61ef6d9979bec4f37a3abbba4b (diff) | |
download | blackbird-op-linux-a8efd58815a8d8bdca409a4b8319281cd9c24f7f.tar.gz blackbird-op-linux-a8efd58815a8d8bdca409a4b8319281cd9c24f7f.zip |
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')
-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, 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; |