mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
drm/radeon/dpm/btc: off by one in btc_set_mc_special_registers()
It should be ">=" instead of ">" here. The table->mc_reg_address[] array has SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE (16) elements. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
89cd67b326
commit
96d8df846f
@ -1930,7 +1930,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev,
|
||||
}
|
||||
j++;
|
||||
|
||||
if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
|
||||
if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
tmp = RREG32(MC_PMG_CMD_MRS);
|
||||
@ -1945,7 +1945,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev,
|
||||
}
|
||||
j++;
|
||||
|
||||
if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
|
||||
if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
|
||||
return -EINVAL;
|
||||
break;
|
||||
case MC_SEQ_RESERVE_M >> 2:
|
||||
@ -1959,7 +1959,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev,
|
||||
}
|
||||
j++;
|
||||
|
||||
if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
|
||||
if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
|
||||
return -EINVAL;
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user