]> Gentwo Git Trees - linux/.git/commitdiff
mfd: da9055: Fix missing regmap_del_irq_chip() in error path
authorHaotian Zhang <vulab@iscas.ac.cn>
Fri, 10 Oct 2025 01:17:36 +0000 (09:17 +0800)
committerLee Jones <lee@kernel.org>
Thu, 6 Nov 2025 14:03:52 +0000 (14:03 +0000)
When da9055_device_init() fails after regmap_add_irq_chip()
succeeds but mfd_add_devices() fails, the error handling path
only calls mfd_remove_devices() but forgets to call
regmap_del_irq_chip(). This results in a resource leak.

Fix this by adding regmap_del_irq_chip() to the error path so
that resources are released properly.

Fixes: 2896434cf272 ("mfd: DA9055 core driver")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20251010011737.1078-1-vulab@iscas.ac.cn
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/da9055-core.c

index 1f727ef60d6387beb104a0bca908126ebad38e2b..8c989b74f924e334ff0fec6b3455d314db913ae8 100644 (file)
@@ -388,6 +388,7 @@ int da9055_device_init(struct da9055 *da9055)
 
 err:
        mfd_remove_devices(da9055->dev);
+       regmap_del_irq_chip(da9055->chip_irq, da9055->irq_data);
        return ret;
 }