diff --git a/sys/dev/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/sys/dev/drm/amd/powerplay/hwmgr/smu10_hwmgr.c --- a/sys/dev/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +++ b/sys/dev/drm/amd/powerplay/hwmgr/smu10_hwmgr.c @@ -741,6 +741,9 @@ { struct smu10_power_state *smu10_ps = cast_smu10_ps(hw_ps); + if (index >= SMU10_MAX_HARDWARE_POWERLEVELS) + return -EINVAL; + smu10_ps->levels[index].engine_clock = 0; smu10_ps->levels[index].vddc_index = 0;