Skip to content

Commit 9eedb91

Browse files
ATRiiXmichalsimek
authored andcommitted
ARM: zynq: Fix refcount leak in zynq_early_slcr_init
of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on error path. Add missing of_node_put() to avoid refcount leak. Fixes: 3329659 ("ARM: zynq: Simplify SLCR initialization") Signed-off-by: Qiheng Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
1 parent 1b929c0 commit 9eedb91

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm/mach-zynq/slcr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ int __init zynq_early_slcr_init(void)
213213
zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr");
214214
if (IS_ERR(zynq_slcr_regmap)) {
215215
pr_err("%s: failed to find zynq-slcr\n", __func__);
216+
of_node_put(np);
216217
return -ENODEV;
217218
}
218219

0 commit comments

Comments
 (0)