drm/radeon/dpm/btc: off by one in btc_set_mc_special_registers()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
---
Resend.
drivers/gpu/drm/radeon/btc_dpm.c +3 -3
@@ -1913,7 +1913,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 );
@@ -1928,7 +1928,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 :
@@ -1942,7 +1942,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 :
Alex Deucher
AppliedQuoted 6 lines · Dan Carpenter
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 <[email protected]>---
Resend.
Applied. thanks!
Alex
Quoted 36 lines
drivers/gpu/drm/radeon/btc_dpm.c +3
-3@@ -1913,7 +1913,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 );@@ -1928,7 +1928,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 :@@ -1942,7 +1942,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 :_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel