clocksource/drivers/integrator-ap: Add missing of_node_put()
authorYangtao Li <tiny.windzz@gmail.com>
Sun, 25 Nov 2018 05:00:49 +0000 (00:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jan 2019 08:32:42 +0000 (09:32 +0100)
commitdecca9bc2116a80821aa1fe0213754d9c5b29cea
treeebc27a4e797866f3200bcd10f451f9077e7fbd93
parent876b79b973f2ca50cd9a57cc4263f91576cf25af
clocksource/drivers/integrator-ap: Add missing of_node_put()

[ Upstream commit 5eb73c831171115d3b4347e1e7124a5a35d8086c ]

The function of_find_node_by_path() acquires a reference to the node
returned by it and that reference needs to be dropped by its caller.

integrator_ap_timer_init_of() doesn't do that.  The pri_node and the
sec_node are used as an identifier to compare against the current
node, so we can directly drop the refcount after getting the node from
the path as it is not used as pointer.

By dropping the refcount right after getting it, a single variable is
needed instead of two.

Fix this by use a single variable and drop the refcount right after
of_find_node_by_path().

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/timer-integrator-ap.c