On Thu, Jul 31, 2014 at 06:22:17PM +0300, Dan Carpenter wrote:
> This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
> 
> Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
> Signed-off-by: Dan Carpenter <[email protected]>
> 
> diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c 
> b/drivers/pinctrl/pinctrl-tegra-xusb.c
> index a066204..419a047 100644
> --- a/drivers/pinctrl/pinctrl-tegra-xusb.c
> +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
> @@ -680,7 +680,7 @@ static struct phy *tegra_xusb_padctl_xlate(struct device 
> *dev,
>       if (args->args_count <= 0)
>               return ERR_PTR(-EINVAL);
>  
> -     if (index > ARRAY_SIZE(padctl->phys))
> +     if (index >= ARRAY_SIZE(padctl->phys))
>               return ERR_PTR(-EINVAL);
>  
>       return padctl->phys[index];

Good catch!

Acked-by: Thierry Reding <[email protected]>

Attachment: pgpzOxE3cdH_I.pgp
Description: PGP signature

Reply via email to