mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
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>
This commit is contained in:
parent
e2ed8a132a
commit
a8efd58815
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue