mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
gpio: mockup: verify the number of GPIO chips requested
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>
This commit is contained in:
parent
20c35ac473
commit
b447a75100
1 changed files with 3 additions and 1 deletions
|
@ -330,7 +330,9 @@ static int __init gpio_mockup_init(void)
|
|||
{
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue