From: "tip-bot2 for Javier Carrasco" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] clocksource/drivers/timer-ti-dm: Fix child node refcount handling
Date: Wed, 13 Nov 2024 20:20:48 -0000 [thread overview]
Message-ID: <173152924816.32228.1809322097420256013.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20241031-timer-ti-dm-systimer-of_node_put-v3-1-063ee822b73a@gmail.com>
The following commit has been merged into the timers/core branch of tip:
Commit-ID: e5cfc0989d9a2849c51c720a16b90b2c061a1aeb
Gitweb: https://git.kernel.org/tip/e5cfc0989d9a2849c51c720a16b90b2c061a1aeb
Author: Javier Carrasco <javier.carrasco.cruz@gmail.com>
AuthorDate: Thu, 31 Oct 2024 13:54:23 +01:00
Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Wed, 13 Nov 2024 13:49:33 +01:00
clocksource/drivers/timer-ti-dm: Fix child node refcount handling
of_find_compatible_node() increments the node's refcount, and it must be
decremented again with a call to of_node_put() when the pointer is no
longer required to avoid leaking the resource.
Instead of adding the missing calls to of_node_put() in all execution
paths, use the cleanup attribute for 'arm_timer' by means of the
__free() macro, which automatically calls of_node_put() when the
variable goes out of scope.
Fixes: 25de4ce5ed02 ("clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241031-timer-ti-dm-systimer-of_node_put-v3-1-063ee822b73a@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/timer-ti-dm-systimer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c
index c2dcd8d..d1c144d 100644
--- a/drivers/clocksource/timer-ti-dm-systimer.c
+++ b/drivers/clocksource/timer-ti-dm-systimer.c
@@ -686,9 +686,9 @@ subsys_initcall(dmtimer_percpu_timer_startup);
static int __init dmtimer_percpu_quirk_init(struct device_node *np, u32 pa)
{
- struct device_node *arm_timer;
+ struct device_node *arm_timer __free(device_node) =
+ of_find_compatible_node(NULL, NULL, "arm,armv7-timer");
- arm_timer = of_find_compatible_node(NULL, NULL, "arm,armv7-timer");
if (of_device_is_available(arm_timer)) {
pr_warn_once("ARM architected timer wrap issue i940 detected\n");
return 0;
prev parent reply other threads:[~2024-11-13 20:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 12:54 [PATCH v3] clocksource/drivers/timer-ti-dm: fix " Javier Carrasco
2024-11-04 14:02 ` Daniel Lezcano
2024-11-13 20:20 ` tip-bot2 for Javier Carrasco [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=173152924816.32228.1809322097420256013.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=daniel.lezcano@linaro.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®