提交 96d8df84 编写于 作者: D Dan Carpenter 提交者: Alex Deucher

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
上级 89cd67b3
...@@ -1930,7 +1930,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, ...@@ -1930,7 +1930,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev,
} }
j++; j++;
if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
return -EINVAL; return -EINVAL;
tmp = RREG32(MC_PMG_CMD_MRS); tmp = RREG32(MC_PMG_CMD_MRS);
...@@ -1945,7 +1945,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, ...@@ -1945,7 +1945,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev,
} }
j++; j++;
if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
return -EINVAL; return -EINVAL;
break; break;
case MC_SEQ_RESERVE_M >> 2: case MC_SEQ_RESERVE_M >> 2:
...@@ -1959,7 +1959,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, ...@@ -1959,7 +1959,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev,
} }
j++; j++;
if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
return -EINVAL; return -EINVAL;
break; break;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册