Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1eaf4ba authored by Liang He's avatar Liang He Committed by Greg Kroah-Hartman
Browse files

xtensa: Fix refcount leak bug in time.c



commit a0117dc956429f2ede17b323046e1968d1849150 upstream.

In calibrate_ccount(), of_find_compatible_node() will return a node
pointer with refcount incremented. We should use of_node_put() when
it is not used anymore.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarLiang He <windhl@126.com>
Message-Id: <20220617124432.4049006-1-windhl@126.com>
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0715d0e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ static void __init calibrate_ccount(void)
	cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");
	if (cpu) {
		clk = of_clk_get(cpu, 0);
		of_node_put(cpu);
		if (!IS_ERR(clk)) {
			ccount_freq = clk_get_rate(clk);
			return;