Commit 4ec7fc4a authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Jason Cooper

bus: 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: default avatarJisheng Zhang <jszhang@marvell.com>
Reviewed-by: default avatarEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>

Conflicts:
	drivers/bus/mvebu-mbus.c
parent abe511ac
...@@ -700,6 +700,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, ...@@ -700,6 +700,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
phys_addr_t sdramwins_phys_base, phys_addr_t sdramwins_phys_base,
size_t sdramwins_size) size_t sdramwins_size)
{ {
struct device_node *np;
int win; int win;
mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size); mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
...@@ -712,8 +713,11 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, ...@@ -712,8 +713,11 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
return -ENOMEM; return -ENOMEM;
} }
if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric")) np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
if (np) {
mbus->hw_io_coherency = 1; mbus->hw_io_coherency = 1;
of_node_put(np);
}
for (win = 0; win < mbus->soc->num_wins; win++) for (win = 0; win < mbus->soc->num_wins; win++)
mvebu_mbus_disable_window(mbus, win); mvebu_mbus_disable_window(mbus, win);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment