]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: equilibrium: Fix device node reference leak in pinbank_init()
authorFelix Gu <ustc.gu@gmail.com>
Mon, 26 Jan 2026 17:30:07 +0000 (01:30 +0800)
committerLinus Walleij <linusw@kernel.org>
Wed, 28 Jan 2026 07:56:35 +0000 (08:56 +0100)
When calling of_parse_phandle_with_fixed_args(), the caller is
responsible to call of_node_put() to release the reference of device
node.

In pinbank_init(), the reference of the node obtained from the
"gpio-ranges" property is never released, resulting in a reference
count leak.

Add the missing of_node_put() call to fix the leak.

Fixes: 1948d5c51dba ("pinctrl: Add pinmux & GPIO controller driver for a new SoC")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/pinctrl-equilibrium.c

index 2d04829b29c9976fdebbaa56e6c1407eafa121a9..48b55c5bf8d4fd23d9475735029d11f6a476b407 100644 (file)
@@ -846,6 +846,7 @@ static int pinbank_init(struct device_node *np,
 
        bank->pin_base = spec.args[1];
        bank->nr_pins = spec.args[2];
+       of_node_put(spec.np);
 
        bank->aval_pinmap = readl(bank->membase + REG_AVAIL);
        bank->id = id;