From: Alexandre Belloni <alexandre.belloni@bootlin•com>
To: Yuho Choi <dbgh9129@gmail•com>
Cc: Michael Turquette <mturquette@baylibre•com>,
Stephen Boyd <sboyd@kernel•org>,
Nicolas Ferre <nicolas.ferre@microchip•com>,
Claudiu Beznea <claudiu.beznea@tuxon•dev>,
Brian Masney <bmasney@redhat•com>, Kees Cook <kees@kernel•org>,
"Rafael J. Wysocki (Intel)" <rafael@kernel•org>,
Thierry Reding <treding@nvidia•com>,
linux-clk@vger•kernel.org, linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH v1] clk: at91: keep securam node alive while mapping it
Date: Fri, 29 May 2026 23:02:43 +0200 [thread overview]
Message-ID: <20260529210243877820a5@mail.local> (raw)
In-Reply-To: <20260529042051.1626978-1-dbgh9129@gmail.com>
On 29/05/2026 00:20:51-0400, Yuho Choi wrote:
> pmc_register_ops() gets an owned reference to the
> "atmel,sama5d2-securam" node with of_find_compatible_node(). The
> success path dropped that reference before passing the node to
> of_iomap(), leaving of_iomap() to consume a node pointer after the caller
> had released its reference.
>
> Move of_node_put() after of_iomap() so the node remains referenced for
> the mapping operation. The unavailable-node error path already releases
> the reference.
>
> Fixes: 4d21be864092 ("clk: at91: pmc: execute suspend/resume only for backup mode")
> Signed-off-by: Yuho Choi <dbgh9129@gmail•com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin•com>
> ---
> drivers/clk/at91/pmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
> index b618a5e00b00..03a6c31d6aa8 100644
> --- a/drivers/clk/at91/pmc.c
> +++ b/drivers/clk/at91/pmc.c
> @@ -180,9 +180,9 @@ static int __init pmc_register_ops(void)
> of_node_put(np);
> return -ENODEV;
> }
> - of_node_put(np);
>
> at91_pmc_backup_suspend = of_iomap(np, 0);
> + of_node_put(np);
> if (!at91_pmc_backup_suspend) {
> pr_warn("%s(): unable to map securam\n", __func__);
> return -ENOMEM;
> --
> 2.43.0
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-05-29 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 4:20 [PATCH v1] clk: at91: keep securam node alive while mapping it Yuho Choi
2026-05-29 21:02 ` Alexandre Belloni [this message]
2026-06-01 15:20 ` Brian Masney
2026-06-02 6:51 ` Claudiu Beznea
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=20260529210243877820a5@mail.local \
--to=alexandre.belloni@bootlin$(echo .)com \
--cc=bmasney@redhat$(echo .)com \
--cc=claudiu.beznea@tuxon$(echo .)dev \
--cc=dbgh9129@gmail$(echo .)com \
--cc=kees@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-clk@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mturquette@baylibre$(echo .)com \
--cc=nicolas.ferre@microchip$(echo .)com \
--cc=rafael@kernel$(echo .)org \
--cc=sboyd@kernel$(echo .)org \
--cc=treding@nvidia$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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