
9 Sep
2022
9 Sep
'22
5:17 p.m.
If the tree is not valid we should not register it. Update the function to check this first.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/core/ofnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 6bdab6886b6..9a782e7b19f 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -51,7 +51,7 @@ static oftree oftree_ensure(void *fdt) oftree tree; int i;
- if (gd->flags & GD_FLG_RELOC) { + if (fdt && (gd->flags & GD_FLG_RELOC)) { i = oftree_find(fdt); if (i == -1) { if (oftree_count == CONFIG_OFNODE_MULTI_TREE_MAX) {
--
2.37.2.789.g6183377224-goog