clk: berlin: Add of_node_put() for of_get_parent()
authorLiang He <windhl@126.com>
Fri, 8 Jul 2022 08:49:00 +0000 (16:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:04 +0000 (12:35 +0200)
commit49343bdf95ebee048cac71727498b15f90f6b236
tree993abb4c7dd9a1e090f3c947327e95af5aba3549
parent857b719bede43b03a1cce634c5e8b8464b36ccd9
clk: berlin: Add of_node_put() for of_get_parent()

[ Upstream commit 37c381b812dcbfde9c3f1f3d3e75fdfc1b40d5bc ]

In berlin2_clock_setup() and berlin2q_clock_setup(), we need to
call of_node_put() for the reference returned by of_get_parent()
which has increased the refcount. We should call *_put() in fail
path or when it is not used anymore.

Fixes: 26b3b6b959b2 ("clk: berlin: prepare simple-mfd conversion")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220708084900.311684-1-windhl@126.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/berlin/bg2.c
drivers/clk/berlin/bg2q.c