summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2021-06-11 21:11:52 +0800
committerRob Herring <robh@kernel.org>2021-06-24 13:47:26 -0600
commit3c6867a12a224db1ff83b68a8ae91ece26986e1f (patch)
tree4864727a6d0838fd0c0edc6d779cd22aa2a7db9f /drivers/of
parent972d6a7dcec3ad3226661034c5d8cb2d30585157 (diff)
of: of_reserved_mem: only call memblock_free for normal reserved memory
For nomap case, the memory block will be removed by memblock_remove() in early_init_dt_alloc_reserved_memory_arch(). So it's meaningless to call memblock_free() on error path. Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Link: https://lore.kernel.org/r/20210611131153.3731147-1-aisheng.dong@nxp.com Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_reserved_mem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 333d33bad59d..b1d7fc39f953 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -275,9 +275,10 @@ void __init fdt_init_reserved_mem(void)
if (err != 0 && err != -ENOENT) {
pr_info("node %s compatible matching fail\n",
rmem->name);
- memblock_free(rmem->base, rmem->size);
if (nomap)
memblock_add(rmem->base, rmem->size);
+ else
+ memblock_free(rmem->base, rmem->size);
}
}
}