Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

tom will and committed by
Alex Deucher
a8efd588 e2ed8a13

+1 -1
+1 -1
drivers/gpu/drm/radeon/kv_dpm.c
··· 2164 2164 if (pi->caps_stable_p_state) { 2165 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 2168 if (stable_p_state_sclk >= table->entries[i].clk) { 2169 2169 stable_p_state_sclk = table->entries[i].clk; 2170 2170 break;