gpio: Fix range check in of_gpio_simple_xlate()
PATCH 1/1 gpio: Fix range check in of_gpio_simple_xlate()
This patch fixes a range check in of_gpio_simple_xlate() by replacing a "> gc->ngpio" with ">= gc->ngpio" since range is from 0 to gc->ngpio - 1
Signed-off-by Roland Stigge <[email protected]>
---
Applies to v3.4-rc1
drivers/of/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/gpio.c +1 -1
@@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chiif (WARN_ON (gpiospec->args_count < gc->of_gpio_n_cells))return -EINVAL ; -if (gpiospec->args[0 ] > gc->ngpio) +if (gpiospec->args[0 ] >= gc->ngpio)return -EINVAL ;if (flags)
PATCH 1/1 gpio: Fix range check in of_gpio_simple_xlate()
Quoted 4 lines · Roland Stigge
This patch fixes a range check in
of_gpio_simple_xlate()by replacing a ">gc->ngpio" with ">=gc->ngpio" since range is from 0 togc->ngpio- 1Signed-off-by Roland Stigge <[email protected]>
CC stable at vger.kernel.org
Grant Likely
AppliedPATCH 1/1 gpio: Fix range check in of_gpio_simple_xlate()
In reply to Roland StiggeQuoted 4 lines · Roland Stigge
This patch fixes a range check in
of_gpio_simple_xlate()by replacing a ">gc->ngpio" with ">=gc->ngpio" since range is from 0 togc->ngpio- 1Signed-off-by Roland Stigge <[email protected]>
Applied, thanks.
g.
Quoted 19 lines
---
Applies to v3.4-rc1
drivers/of/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/of/gpio.c +1
-1@@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chiif (WARN_ON (gpiospec->args_count < gc->of_gpio_n_cells))return -EINVAL ; -if (gpiospec->args[0 ] > gc->ngpio) +if (gpiospec->args[0 ] >= gc->ngpio)return -EINVAL ;if (flags)
Signature · 2 lines
Grant Likely, B.Sc, P.Eng. Secret Lab Technologies,Ltd.