Commit 8e1594db7e43eaf4ea88b870e97fa3ab9f8f98e0

Authored by Dan Carpenter
Committed by Linus Walleij
1 parent 99e872d953

pinctrl: tegra-xusb: fix an off by one test

This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".

Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/pinctrl/pinctrl-tegra-xusb.c
... ... @@ -680,7 +680,7 @@
680 680 if (args->args_count <= 0)
681 681 return ERR_PTR(-EINVAL);
682 682  
683   - if (index > ARRAY_SIZE(padctl->phys))
  683 + if (index >= ARRAY_SIZE(padctl->phys))
684 684 return ERR_PTR(-EINVAL);
685 685  
686 686 return padctl->phys[index];