summaryrefslogtreecommitdiffstats
path: root/common/oftree.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/oftree.c')
-rw-r--r--common/oftree.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/oftree.c b/common/oftree.c
index 82e5ddd60b..555aa0b602 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -422,7 +422,13 @@ struct fdt_header *of_get_fixed_tree(struct fdt_header *fdt)
int size, align;
if (!fdt) {
- fdt = internalfdt = of_flatten_dtb();
+ struct device_node *root_node;
+
+ root_node = of_get_root_node();
+ if (!root_node)
+ return NULL;
+
+ fdt = internalfdt = of_flatten_dtb(root_node);
if (!fdt)
return NULL;
}