mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 31 Jul 2022 09:55:38 +0000 (11:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:18 +0000 (12:35 +0200)
commitb940bb3c81544f5f021e22114c39a22c96ef1a0d
treed6272b0233bb503901ebc4d9805930dc0369808c
parent0715005c483e71263e16a8d9caca6786dbc1740c
mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init()

[ Upstream commit 557244f6284f30613f2d61f14b579303165876c3 ]

In lp8788_irq_init(), if an error occurs after a successful
irq_domain_add_linear() call, it must be undone by a corresponding
irq_domain_remove() call.

irq_domain_remove() should also be called in lp8788_irq_exit() for the same
reason.

Fixes: eea6b7cc53aa ("mfd: Add lp8788 mfd driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/bcd5a72c9c1c383dd6324680116426e32737655a.1659261275.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/lp8788-irq.c