Re: [PATCH] gpio: mockup: reject invalid gpio_mockup_ranges widths
From: Bartosz Golaszewski
Date: Tue Jun 09 2026 - 07:22:25 EST
On Tue, 09 Jun 2026 00:45:38 +0000, Samuel Moelius wrote:
> gpio-mockup validates only that each second gpio_mockup_ranges value is
> non-negative before creating the mock chips. The fixed-base form uses
> the second value as the first GPIO number after the range, while the
> dynamic-base form uses it as the number of GPIOs.
>
> gpio_mockup_register_chip() stores the resulting number of GPIOs in a
> u16 and passes it through a PROPERTY_ENTRY_U16("nr-gpios", ...). Values
> greater than U16_MAX therefore truncate silently. For example,
> gpio_mockup_ranges=-1,65537 creates a one-line mock GPIO chip instead of
> rejecting the invalid request.
>
> [...]
Applied, thanks!
[1/1] gpio: mockup: reject invalid gpio_mockup_ranges widths
https://git.kernel.org/brgl/c/446e8c31d0fc7f1d92c06c2d2f7e7ed27f55f0c6
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>