mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
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
This commit is contained in:
parent
272b98c645
commit
abe511ac85
3 changed files with 9 additions and 1 deletions
|
@ -140,6 +140,7 @@ int __init coherency_init(void)
|
||||||
coherency_base = of_iomap(np, 0);
|
coherency_base = of_iomap(np, 0);
|
||||||
coherency_cpu_base = of_iomap(np, 1);
|
coherency_cpu_base = of_iomap(np, 1);
|
||||||
set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
|
set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
|
||||||
|
of_node_put(np);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -147,9 +148,14 @@ int __init coherency_init(void)
|
||||||
|
|
||||||
static int __init coherency_late_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,
|
bus_register_notifier(&platform_bus_type,
|
||||||
&mvebu_hwcc_platform_nb);
|
&mvebu_hwcc_platform_nb);
|
||||||
|
of_node_put(np);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ int __init armada_370_xp_pmsu_init(void)
|
||||||
pr_info("Initializing Power Management Service Unit\n");
|
pr_info("Initializing Power Management Service Unit\n");
|
||||||
pmsu_mp_base = of_iomap(np, 0);
|
pmsu_mp_base = of_iomap(np, 0);
|
||||||
pmsu_reset_base = of_iomap(np, 1);
|
pmsu_reset_base = of_iomap(np, 1);
|
||||||
|
of_node_put(np);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -98,6 +98,7 @@ static int __init mvebu_system_controller_init(void)
|
||||||
BUG_ON(!match);
|
BUG_ON(!match);
|
||||||
system_controller_base = of_iomap(np, 0);
|
system_controller_base = of_iomap(np, 0);
|
||||||
mvebu_sc = (struct mvebu_system_controller *)match->data;
|
mvebu_sc = (struct mvebu_system_controller *)match->data;
|
||||||
|
of_node_put(np);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue