diff --git a/sys/dev/drm/amd/powerplay/smumgr/vegam_smumgr.c b/sys/dev/drm/amd/powerplay/smumgr/vegam_smumgr.c --- a/sys/dev/drm/amd/powerplay/smumgr/vegam_smumgr.c +++ b/sys/dev/drm/amd/powerplay/smumgr/vegam_smumgr.c @@ -1327,7 +1327,8 @@ struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); uint32_t vddci; - table->UvdLevelCount = (uint8_t)(mm_table->count); + table->UvdLevelCount = (uint8_t)((SMU75_MAX_LEVELS_UVD < mm_table->count) ? + SMU75_MAX_LEVELS_UVD : mm_table->count); table->UvdBootLevel = 0; for (count = 0; count < table->UvdLevelCount; count++) {