Re: [PATCH] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
From: Bartosz Golaszewski
Date: Thu Oct 15 2026 - 08:10:54 EST
On Thu, 15 Oct 2026 10:57:49 +0800, Kent Gibson wrote:
> A drive-by review by Sashiko reports that, after a failed call to
> gpiochip_set_multiple(), gpiod_set_array_value() returns abruptly,
> bypassing the freeing of possibly alloced bitmaps, potentially leaking
> memory. It is an unlikely error path, but is possible.
>
> Defer the return code check until after the bitmap_free() block.
>
> [...]
Applied, thanks!
[1/1] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
https://git.kernel.org/brgl/c/c28846ca1ac6134881114d272314623c8433e372
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>