[patch -next] drm/radeon/dpm/btc: off by one in btc_set_mc_special_registers()

Alex Deucher alexdeucher at gmail.com
Wed Oct 2 17:33:44 CEST 2013


On Fri, Sep 27, 2013 at 4:18 PM, Dan Carpenter <dan.carpenter at oracle.com> wrote:
> 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 at oracle.com>
> ---
> Resend.

Applied.  thanks!

Alex

>
> diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
> index bab0185..55491e7 100644
> --- a/drivers/gpu/drm/radeon/btc_dpm.c
> +++ b/drivers/gpu/drm/radeon/btc_dpm.c
> @@ -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
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list