Re: [PATCH] gpiolib: Free chip resources when allocating the label fails

From: Bartosz Golaszewski

Date: Tue Oct 20 2026 - 09:04:19 EST



On Sun, 18 Oct 2026 13:44:56 +0900, Baek Kyu, Kim wrote:
> If desc_set_label() fails after the chip's request callback succeeds,
> gpiod_request_commit() clears GPIOD_FLAG_REQUESTED without calling the
> free callback. The caller receives an error and has no GPIO to release,
> leaving resources acquired by the request callback held.
>
> Call the chip's free callback, if present, before clearing the requested
> bit on label allocation failure. Leave request callback errors on the
> existing path to avoid freeing a failed request.
>
> [...]

Applied, thanks!

[1/1] gpiolib: Free chip resources when allocating the label fails
https://git.kernel.org/brgl/c/8381e1f15e27087fcb6f07046a526ac8b9b9b2b9

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