提交 b447a751 编写于 作者: B Bartosz Golaszewski 提交者: Linus Walleij

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: NBartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 20c35ac4
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册