Skip to content

Commit 22fa1c3

Browse files
Uuuuuuhoclaudiubeznea
authored andcommitted
clk: at91: keep securam node alive while mapping it
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: 4d21be8 ("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> Link: https://patch.msgid.link/20260529042051.1626978-1-dbgh9129@gmail.com Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
1 parent c8a3be5 commit 22fa1c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/clk/at91/pmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ static int __init pmc_register_ops(void)
180180
of_node_put(np);
181181
return -ENODEV;
182182
}
183-
of_node_put(np);
184183

185184
at91_pmc_backup_suspend = of_iomap(np, 0);
185+
of_node_put(np);
186186
if (!at91_pmc_backup_suspend) {
187187
pr_warn("%s(): unable to map securam\n", __func__);
188188
return -ENOMEM;

0 commit comments

Comments
 (0)