diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2013-08-27 08:41:14 +0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2013-09-18 20:40:53 +0400 |
commit | abe511ac85de60f6d6ce1272b91c079d73bf8517 (patch) | |
tree | 723e206ba90e190aaabfe4aa3e53be0e06ebb6de /arch/arm/mach-mvebu/coherency.c | |
parent | 272b98c6455f00884f0350f775c5342358ebb73f (diff) | |
download | linux-abe511ac85de60f6d6ce1272b91c079d73bf8517.tar.xz |
ARM: mvebu: add missing of_node_put() to fix reference leak
Add of_node_put to properly decrement the refcount when we are
done using a given node.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Reviewed-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Conflicts:
arch/arm/mach-mvebu/armada-370-xp.c
arch/arm/mach-mvebu/platsmp.c
Diffstat (limited to 'arch/arm/mach-mvebu/coherency.c')
-rw-r--r-- | arch/arm/mach-mvebu/coherency.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 4c24303ec481..58adf2fd9cfc 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c @@ -140,6 +140,7 @@ int __init coherency_init(void) coherency_base = of_iomap(np, 0); coherency_cpu_base = of_iomap(np, 1); set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); + of_node_put(np); } return 0; @@ -147,9 +148,14 @@ int __init coherency_init(void) static int __init coherency_late_init(void) { - if (of_find_matching_node(NULL, of_coherency_table)) + struct device_node *np; + + np = of_find_matching_node(NULL, of_coherency_table); + if (np) { bus_register_notifier(&platform_bus_type, &mvebu_hwcc_platform_nb); + of_node_put(np); + } return 0; } |