summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/nomadik
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-06-07 15:16:01 +0400
committerLinus Walleij <linus.walleij@linaro.org>2022-06-15 16:04:01 +0200
commit4b32e054335ea0ce50967f63a7bfd4db058b14b9 (patch)
tree6abbbc83a3aca0ed6bd4c0e7822871eaaa999059 /drivers/pinctrl/nomadik
parent2ed2c3814951e7cff982b26c81917e6bbb10f3ae (diff)
downloadlinux-stable-4b32e054335ea0ce50967f63a7bfd4db058b14b9.tar.gz
linux-stable-4b32e054335ea0ce50967f63a7bfd4db058b14b9.tar.bz2
linux-stable-4b32e054335ea0ce50967f63a7bfd4db058b14b9.zip
pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak." Fixes: c2f6d059abfc ("pinctrl: nomadik: refactor DT parser to take two paths") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220607111602.57355-1-linmq006@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/nomadik')
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-nomadik.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index 640e50d94f27..f5014d09d81a 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1421,8 +1421,10 @@ static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
has_config = nmk_pinctrl_dt_get_config(np, &configs);
np_config = of_parse_phandle(np, "ste,config", 0);
- if (np_config)
+ if (np_config) {
has_config |= nmk_pinctrl_dt_get_config(np_config, &configs);
+ of_node_put(np_config);
+ }
if (has_config) {
const char *gpio_name;
const char *pin;