Skip to content

Commit efdcbc1

Browse files
opsiffgregkh
authored andcommitted
gpio: regmap: Fix memleak in error path in gpio_regmap_register()
commit 52721cf upstream. Call gpiochip_remove() to free the resources allocated by gpiochip_add_data() in error path. Fixes: 553b75d ("gpio: regmap: Allow to allocate regmap-irq device") Fixes: ae49581 ("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>
1 parent 0f59401 commit efdcbc1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpio/gpio-regmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
328328
config->regmap_irq_line, config->regmap_irq_flags,
329329
0, config->regmap_irq_chip, &gpio->irq_chip_data);
330330
if (ret)
331-
goto err_free_bitmap;
331+
goto err_remove_gpiochip;
332332

333333
irq_domain = regmap_irq_get_domain(gpio->irq_chip_data);
334334
} else

0 commit comments

Comments
 (0)