summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-07-23 13:27:58 +0100
committerMark Brown <broonie@kernel.org>2026-07-23 13:27:58 +0100
commit0dde78a678353f550310dc06e66de6802bfc702c (patch)
treea45cc6c393de04fd2ba105249abaf5c0ee8f24c6 /drivers/of
parent1ebd17e5b2483c1c910c9d798cde497713b939ce (diff)
parentdb3dbdfea1b8f38774419c5c2c14e4b81c48708d (diff)
downloadlinux-next-0dde78a678353f550310dc06e66de6802bfc702c.tar.gz
linux-next-0dde78a678353f550310dc06e66de6802bfc702c.zip
Merge branch 'dt/linus' of https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_reserved_mem.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 82222bd45ac6..42e3e2d8a2b8 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -359,6 +359,7 @@ int __init fdt_scan_reserved_mem(void)
err = __reserved_mem_reserve_reg(child, uname);
if (!err)
count++;
+
/*
* Save the nodes for the dynamically-placed regions
* into an array which will be used for allocation right
@@ -366,10 +367,17 @@ int __init fdt_scan_reserved_mem(void)
* or marked as no-map. This is done to avoid dynamically
* allocating from one of the statically-placed regions.
*/
- if (err == -ENOENT && of_get_flat_dt_prop(child, "size", NULL)) {
- dynamic_nodes[dynamic_nodes_cnt] = child;
- dynamic_nodes_cnt++;
+ if (err != -ENOENT || !of_get_flat_dt_prop(child, "size", NULL))
+ continue;
+
+ if (dynamic_nodes_cnt == MAX_RESERVED_REGIONS) {
+ pr_err("too many defined dynamic regions, skip '%s'\n",
+ uname);
+ continue;
}
+
+ dynamic_nodes[dynamic_nodes_cnt] = child;
+ dynamic_nodes_cnt++;
}
for (int i = 0; i < dynamic_nodes_cnt; i++) {
const char *uname;