Re: [PATCH] gpio: timberdale: fix off-by-one in IRQ type boundary check

From: Bartosz Golaszewski
Date: Tue Aug 26 2025 - 06:03:33 EST


From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>


On Mon, 25 Aug 2025 17:08:50 +0800, Junjie Cao wrote:
> timbgpio_irq_type() currently accepts offset == ngpio, violating
> gpiolib's [0..ngpio-1] contract. This can lead to undefined behavior
> when computing '1 << offset', and it is also inconsistent with users
> that iterate with for_each_set_bit(..., ngpio).
>
> Tighten the upper bound to reject offset == ngpio. No functional change
> for in-range offsets.
>
> [...]

Applied, thanks!

[1/1] gpio: timberdale: fix off-by-one in IRQ type boundary check
https://git.kernel.org/brgl/linux/c/810e154d90f44127239957b06ee51a55553a5815

Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>