diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c index bba81216b4dbbbaee8b097a10a2ce505bd4bea9d..bf984b6dc477ce837c0a49ff265830e6efad2d80 100644 --- a/drivers/of/gpio.c +++ b/drivers/of/gpio.c @@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chip *gc, if (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)