Re: [PATCH] gpio: of: fix potential misconfiguration of hogged lines

From: Mika Westerberg

Date: Fri Nov 06 2026 - 09:14:50 EST


On Thu, Nov 05, 2026 at 02:37:52PM +0100, Bartosz Golaszewski wrote:
> In of_gpiochip_get_lflags() the local variable xlate_flags is declared
> without being initialized before its address is passed to
> of_xlate_and_get_gpiod_flags() when processing a devicetree gpio-hog
> child node. If a driver uses an of_xlate() callback that doesn't update
> the flags argument (like gpiochip_fwd_delay_of_xlate()) we'll end up
> passing that uninitialized value to of_convert_gpio_flags(), potentially
> misconfiguring the hogged GPIO.
>
> Initialize xlate_flags to 0.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: d1d564ec4992 ("gpio: move hogs into GPIO core")
> Closes: https://sashiko.dev/#/bug/linux-2bb44847-fd6e-406c-878d-9739da2cb8b5
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>

Reviewed-by: Mika Westerberg <westeri@xxxxxxxxxx>