drm/amd/powerplay: fix static checker warnings in iceland_smc.c
add array length check to avoid buffer overflow. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
02cfb5fccb
commit
e07053241b
|
@ -2458,7 +2458,7 @@ static int iceland_set_mc_special_registers(struct pp_hwmgr *hwmgr,
|
|||
PP_ASSERT_WITH_CODE((j <= SMU71_DISCRETE_MC_REGISTER_ARRAY_SIZE),
|
||||
"Invalid VramInfo table.", return -EINVAL);
|
||||
|
||||
if (!data->is_memory_gddr5) {
|
||||
if (!data->is_memory_gddr5 && j < SMU71_DISCRETE_MC_REGISTER_ARRAY_SIZE) {
|
||||
table->mc_reg_address[j].s1 = mmMC_PMG_AUTO_CMD;
|
||||
table->mc_reg_address[j].s0 = mmMC_PMG_AUTO_CMD;
|
||||
for (k = 0; k < table->num_entries; k++) {
|
||||
|
|
Loading…
Reference in a new issue