ARM: hisi: add missing of_node_put calls
Commit Message
A node that is returned by of_find_compatible_node has its refcount
incremented. We have to call of_node_put when the node is no longer
needed.
For hip04_smp_init, the easiest option is to call of_node_put for all
nodes at the end of the function. If we jump to the end of the function
because of an error, unused local np... pointers are NULL by default
and of_node_put(NULL) just returns.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
compile-tested only, I don't have this hardware
arch/arm/mach-hisi/platmcpm.c | 3 +++
1 file changed, 3 insertions(+)
@@ -341,6 +341,9 @@ static int __init hip04_smp_init(void)
err_reloc:
memblock_phys_free(hip04_boot_method[0], hip04_boot_method[1]);
err:
+ of_node_put(np);
+ of_node_put(np_sctl);
+ of_node_put(np_fab);
return ret;
}
early_initcall(hip04_smp_init);