diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2023-01-02 09:20:39 +0100 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-01-02 13:01:14 +0100 |
commit | 694175cd8a1643cde3acb45c9294bca44a8e08e9 (patch) | |
tree | 982876f4681019ac6f80e6f47f81d99429ff6ec6 /drivers/gpio | |
parent | gpio: sprd: Make the irqchip immutable (diff) | |
download | linux-694175cd8a1643cde3acb45c9294bca44a8e08e9.tar.xz linux-694175cd8a1643cde3acb45c9294bca44a8e08e9.zip |
gpio: sifive: Fix refcount leak in sifive_gpio_probe
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>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-sifive.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |