mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: sifive: Fix refcount leak in sifive_gpio_probe
@ 2023-01-02  8:20 Miaoqian Lin
  2023-01-02 12:01 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2023-01-02  8:20 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Palmer Dabbelt,
	Paul Walmsley, Marc Zyngier, Yash Shah, Atish Patra,
	Wesley W. Terpstra, linux-gpio, linux-riscv, linux-kernel
  Cc: linmq006

of_irq_find_parent() returns a node pointer with refcount incremented,
We should use of_node_put() on it when not needed anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 96868dce644d ("gpio/sifive: Add GPIO driver for SiFive SoCs")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/gpio/gpio-sifive.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c
index 238f3210970c..bc5660f61c57 100644
--- a/drivers/gpio/gpio-sifive.c
+++ b/drivers/gpio/gpio-sifive.c
@@ -215,6 +215,7 @@ static int sifive_gpio_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 	parent = irq_find_host(irq_parent);
+	of_node_put(irq_parent);
 	if (!parent) {
 		dev_err(dev, "no IRQ parent domain\n");
 		return -ENODEV;
-- 
2.25.1


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02  8:20 [PATCH] gpio: sifive: Fix refcount leak in sifive_gpio_probe Miaoqian Lin
2023-01-02 12:01 ` Bartosz Golaszewski

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®