Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: equilibrium: Fix device node reference leak in pinbank_init()

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>

authored by

Felix Gu and committed by
Linus Walleij
c0b4a4fe ebd2f48d

+1
+1
drivers/pinctrl/pinctrl-equilibrium.c
··· 846 846 847 847 bank->pin_base = spec.args[1]; 848 848 bank->nr_pins = spec.args[2]; 849 + of_node_put(spec.np); 849 850 850 851 bank->aval_pinmap = readl(bank->membase + REG_AVAIL); 851 852 bank->id = id;