]> git.baikalelectronics.ru Git - kernel.git/commit
clk: ti: Balance of_node_get() calls for of_find_node_by_name()
authorLiang He <windhl@126.com>
Thu, 15 Sep 2022 03:11:21 +0000 (11:11 +0800)
committerStephen Boyd <sboyd@kernel.org>
Sat, 1 Oct 2022 00:14:32 +0000 (17:14 -0700)
commit53dc569c2590e5c28c3d5c79ed2aa42bb717b548
tree865dca4d5001f1ec46f92565b0d4875ee48028b7
parentcd96f7ca361c1f8978b0164f37b085436c7a0a1b
clk: ti: Balance of_node_get() calls for of_find_node_by_name()

In ti_find_clock_provider(), of_find_node_by_name() will call
of_node_put() for the 'from' argument, possibly putting the node one too
many times. Let's maintain the of_node_get() from the previous search
and only put when we're exiting the function early. This should avoid a
misbalanced reference count on the node.

Fixes: 6927a3aa48da ("clk: ti: Add ti_find_clock_provider() to use clock-output-names")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220915031121.4003589-1-windhl@126.com
[sboyd@kernel.org: Rewrite commit text, maintain reference instead of
get again]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/ti/clk.c