Skip to content

Commit

Permalink
pinctrl: stm32: Fix refcount leak in stm32_pctrl_get_irq_domain
Browse files Browse the repository at this point in the history
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: d86f4d7 ("pinctrl: stm32: check irq controller availability at probe")
Signed-off-by: Miaoqian Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
Yuuoniy authored and linusw committed Jan 9, 2023
1 parent a7cc0e2 commit dcef18c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/pinctrl/stm32/pinctrl-stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,7 @@ static struct irq_domain *stm32_pctrl_get_irq_domain(struct platform_device *pde
return ERR_PTR(-ENXIO);

domain = irq_find_host(parent);
of_node_put(parent);
if (!domain)
/* domain not registered yet */
return ERR_PTR(-EPROBE_DEFER);
Expand Down

0 comments on commit dcef18c

Please sign in to comment.