]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: regmap: Fix memleak in error path in gpio_regmap_register()
authorWentao Guan <guanwentao@uniontech.com>
Thu, 4 Dec 2025 10:13:04 +0000 (18:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:25 +0000 (10:14 +0100)
commita39b53ee7fa572fa46e9cece436fa9446d037b01
tree9b415fc600b710094f6b5ccc3941666fc18b592d
parentb56975f463417a295e28e70f6deff50eb6e7ae19
gpio: regmap: Fix memleak in error path in gpio_regmap_register()

commit 52721cfc78c76b09c66e092b52617006390ae96a upstream.

Call gpiochip_remove() to free the resources allocated by
gpiochip_add_data() in error path.

Fixes: 553b75d4bfe9 ("gpio: regmap: Allow to allocate regmap-irq device")
Fixes: ae495810cffe ("gpio: regmap: add the .fixed_direction_output configuration parameter")
CC: stable@vger.kernel.org
Co-developed-by: WangYuli <wangyl5933@chinaunicom.cn>
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20251204101303.30353-1-guanwentao@uniontech.com
[Bartosz: reworked the commit message]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-regmap.c