aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-07-31 11:22:17 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-08-17 10:15:44 -0400
commit8e1594db7e43eaf4ea88b870e97fa3ab9f8f98e0 (patch)
treea534f9b5093dac349e07c539a47600b04972aa0f /drivers
parent99e872d953fb4484029c12dce909f514ae095d8d (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/pinctrl-tegra-xusb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
index a06620474845..419a047b9150 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,
680 if (args->args_count <= 0) 680 if (args->args_count <= 0)
681 return ERR_PTR(-EINVAL); 681 return ERR_PTR(-EINVAL);
682 682
683 if (index > ARRAY_SIZE(padctl->phys)) 683 if (index >= ARRAY_SIZE(padctl->phys))
684 return ERR_PTR(-EINVAL); 684 return ERR_PTR(-EINVAL);
685 685
686 return padctl->phys[index]; 686 return padctl->phys[index];