The number of supported mockup chips is limited. Check this limit when
parsing the module parameters.
Also: make sure that each chip is described with a <base - ngpio> pair.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
 {
        int err;
 
-       if (gpio_mockup_params_nr < 2 || (gpio_mockup_params_nr % 2))
+       if ((gpio_mockup_params_nr < 2) ||
+           (gpio_mockup_params_nr % 2) ||
+           (gpio_mockup_params_nr > GPIO_MOCKUP_MAX_RANGES))
                return -EINVAL;
 
        gpio_mockup_dbg_dir = debugfs_create_dir("gpio-mockup-event", NULL);