pinctrl: tegra-xusb: fix an off by one test
Subsystems (3)
PATCH 1/2 pinctrl: tegra-xusb: fix an off by one test
This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
drivers/pinctrl/pinctrl-tegra-xusb.c +1 -1
@@ -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];
Quoted 4 lines · Dan Carpenter
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]>
This series looks fine to me.
Linus, since the XUSB driver got merged through the Tegra tree, should I send these fixes through arm-soc on top of the driver addition patches (hoping to get them in before -rc1), or will you take them through the pinctrl tree immediately after -rc1? The latter might be simpler.
Quoted 10 lines · Stephen Warren
Quoted 6 lines · Dan Carpenter
This shoudld be ">=
ARRAY_SIZE()" instead of ">ARRAY_SIZE()".Fixes dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controllersupport')
Signed-off-by Dan Carpenter <[email protected]>This series looks fine to me.
I record this as an Acked-by.
Quoted 4 lines
Linus, since the XUSB driver got merged through the Tegra tree, should I send these fixes through arm-soc on top of the driver addition patches (hoping to get them in before -rc1), or will you take them through the pinctrl tree immediately after -rc1? The latter might be simpler.
Yeah I'm carrying them.
Thanks!
Linus Walleij
Quoted 10 lines · Dan Carpenter
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]>drivers/pinctrl/pinctrl-tegra-xusb.c +0
-0
drivers/pinctrl/pinctrl-tegra-xusb.c static struct phy *tegra_xusb_padctl_xlate(struct device *dev, · line 686
Quoted 8 lines
drivers/pinctrl/pinctrl-tegra-xusb.c +1
-1@@ -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!
Quoted 4 lines · Dan Carpenter
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]>
Patch applied with Stephen's and Thierry's ACKs.
Yours,
Linus Walleij