mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pinctrl: samsung: Fix irq handling if an error occurs in exynos_irq_demux_eint16_31()
@ 2024-11-17 12:03 Christophe JAILLET
  2024-11-18  9:40 ` André Draszik
  2024-12-02 14:02 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 6+ messages in thread
From: Christophe JAILLET @ 2024-11-17 12:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Sylwester Nawrocki, Alim Akhtar,
	Linus Walleij, André Draszik
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
	Krzysztof Kozlowski, linux-arm-kernel, linux-samsung-soc,
	linux-gpio

chained_irq_enter(() should be paired with a corresponding
chained_irq_exit().

Here, if clk_enable() fails, a early return occurs and chained_irq_exit()
is not called.

Add a new label and a goto for fix it.

Fixes: f9c744747973 ("pinctrl: samsung: support a bus clock")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only.

Review with care, irq handling is sometimes tricky...
---
 drivers/pinctrl/samsung/pinctrl-exynos.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index b79c211c0374..ac6dc22b37c9 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -636,7 +636,7 @@ static void exynos_irq_demux_eint16_31(struct irq_desc *desc)
 		if (clk_enable(b->drvdata->pclk)) {
 			dev_err(b->gpio_chip.parent,
 				"unable to enable clock for pending IRQs\n");
-			return;
+			goto out;
 		}
 	}
 
@@ -652,6 +652,7 @@ static void exynos_irq_demux_eint16_31(struct irq_desc *desc)
 	if (eintd->nr_banks)
 		clk_disable(eintd->banks[0]->drvdata->pclk);
 
+out:
 	chained_irq_exit(chip, desc);
 }
 
-- 
2.47.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-02 14:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-17 12:03 [PATCH] pinctrl: samsung: Fix irq handling if an error occurs in exynos_irq_demux_eint16_31() Christophe JAILLET
2024-11-18  9:40 ` André Draszik
2024-11-18 17:49   ` Christophe JAILLET
2024-11-18 20:40   ` Christophe JAILLET
2024-11-19  6:35     ` André Draszik
2024-12-02 14:02 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®