lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251204101303.30353-1-guanwentao@uniontech.com>
Date: Thu,  4 Dec 2025 18:13:04 +0800
From: Wentao Guan <guanwentao@...ontech.com>
To: brgl@...nel.org
Cc: andriy.shevchenko@...ux.intel.com,
	mathieu.dubois-briand@...tlin.com,
	ioana.ciornei@....com,
	linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	zhanjun@...ontech.com,
	niecheng1@...ontech.com,
	Wentao Guan <guanwentao@...ontech.com>,
	stable@...r.kernel.org,
	WangYuli <wangyl5933@...naunicom.cn>
Subject: [PATCH v3] gpio: regmap: Fix memleak in gpio_remap_register

We should call gpiochip_remove(chip) to free the resource
alloced by gpiochip_add_data(chip, gpio) after the err path.

Fixes: 553b75d4bfe9 ("gpio: regmap: Allow to allocate regmap-irq device")
Fixes: ae495810cffe ("gpio: regmap: add the .fixed_direction_output configuration parameter")
CC: stable@...r.kernel.org
Co-developed-by: WangYuli <wangyl5933@...naunicom.cn>
Signed-off-by: WangYuli <wangyl5933@...naunicom.cn>
Signed-off-by: Wentao Guan <guanwentao@...ontech.com>
---
changelog in v3:
Add dependency fixes tag which suggested by Andy Shevchenko.
changelog in v2:
1. format commit message.
2. rebase to mainline now.
---
---
 drivers/gpio/gpio-regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index f4267af00027e..c64805dcb9f88 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -328,7 +328,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 						 config->regmap_irq_line, config->regmap_irq_flags,
 						 0, config->regmap_irq_chip, &gpio->irq_chip_data);
 		if (ret)
-			goto err_free_bitmap;
+			goto err_remove_gpiochip;
 
 		irq_domain = regmap_irq_get_domain(gpio->irq_chip_data);
 	} else
-- 
2.20.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ