git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1de1a03
)
fdt: Check for a valid fdt in oftree_ensure()
author
Simon Glass
<sjg@chromium.org>
Sun, 12 Nov 2023 15:27:45 +0000
(08:27 -0700)
committer
Tom Rini
<trini@konsulko.com>
Wed, 13 Dec 2023 23:39:05 +0000
(18:39 -0500)
Check the header before starting to use it, since this could provide
very confusing later, when ofnode calls start to fail.
Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/core/ofnode.c
patch
|
blob
|
history
diff --git
a/drivers/core/ofnode.c
b/drivers/core/ofnode.c
index
f72ea41
..
21a233f
100644
(file)
--- a/
drivers/core/ofnode.c
+++ b/
drivers/core/ofnode.c
@@
-83,6
+83,11
@@
static oftree oftree_ensure(void *fdt)
if (check_tree_count())
return oftree_null();
+ if (fdt_check_header(fdt)) {
+ log_err("Invalid device tree blob header\n");
+ return oftree_null();
+ }
+
/* register the new tree */
i = oftree_count++;
oftree_list[i] = fdt;