Message ID | 1497008492-14907-4-git-send-email-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
On Fri, Jun 9, 2017 at 1:41 PM, Bartosz Golaszewski <brgl@bgdev.pl> wrote: > Currently we ignore the last odd range value, since each chip is > described by two values. Be more strict and require the user to > pass an even number of ranges. > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Patch applied. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index d78e8e0..d95d37a 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -334,7 +334,7 @@ static int gpio_mockup_probe(struct platform_device *pdev) int ret, i, base, ngpio; char *chip_name; - if (gpio_mockup_params_nr < 2) + if (gpio_mockup_params_nr < 2 || (gpio_mockup_params_nr % 2)) return -EINVAL; chips = devm_kzalloc(dev,
Currently we ignore the last odd range value, since each chip is described by two values. Be more strict and require the user to pass an even number of ranges. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> --- drivers/gpio/gpio-mockup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)