diff options
| author | Kent Gibson <warthog618@gmail.com> | 2026-10-15 10:57:49 +0800 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-10-15 14:10:38 +0200 |
| commit | c28846ca1ac6134881114d272314623c8433e372 (patch) | |
| tree | 700fdfa29f1141060c7afd087f7a398e8cda9adc /scripts/basic/split-include.c | |
| parent | 851bb4a42991666f515040e95e6f40191da9e899 (diff) | |
| download | linux-c28846ca1ac6134881114d272314623c8433e372.tar.gz linux-c28846ca1ac6134881114d272314623c8433e372.zip | |
gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
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.
Fixes: 9b407312755f ("gpiolib: rework the wrapper around gpio_chip::set_multiple()")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/linux-gpio/sashiko-outbox-168233@kernel.org/
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://patch.msgid.link/20261015025749.47039-1-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
