On 2026-07-09T14:28:59, Pranav Sanwal <[email protected]> wrote:
> gpio: delay: set gpio_count and validate index against it
>
> gpio_delay_probe() never set the uclass's gpio_count for this
> device, leaving it at 0. This left gpio_post_probe()'s claimed/name
> tracking arrays sized for zero entries, and left gpio_delay_xlate()'s
> bounds check validating the requested index against a hardcoded 32
> that has no relation to how many lines this instance actually
> manages (ngpio, from its own 'gpios' property).
>
> Set gpio_count in probe() to the real count, and validate against it
> in xlate(), matching the pattern already used by the generic
> gpio_xlate_offs_flags() default implementation.
>
> Fixes: c866f2f197e2 ("gpio: Add GPIO delay driver")
> Signed-off-by: Pranav Sanwal <[email protected]>
>
> drivers/gpio/gpio-delay.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to