mfd: da9055: Fix missing regmap_del_irq_chip() in error path

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: 2896434cf2 ("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>
This commit is contained in:
Haotian Zhang 2025-10-10 09:17:36 +08:00 committed by Lee Jones
parent c19e675a3c
commit 1b58acfd06

View 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;
}