aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSam Protsenko2019-08-05 20:11:03 +0300
committerTom Rini2019-08-07 15:31:05 -0400
commit24434adbd1c73b59bff3c42691e26cc52cdb262a (patch)
tree4294a5a25abb1e0c1bdc5a24f6ca67bb38b429f4 /common
parentbddd985734653c366c8da073650930fb2e9b5003 (diff)
common: image-android-dt: Fix logic in print fdt info routine
Do not attempt to print fdt info if root node wasn't found. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Diffstat (limited to 'common')
-rw-r--r--common/image-android-dt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/image-android-dt.c b/common/image-android-dt.c
index 69168261793..a2d52df4a2a 100644
--- a/common/image-android-dt.c
+++ b/common/image-android-dt.c
@@ -78,17 +78,18 @@ static void android_dt_print_fdt_info(const struct fdt_header *fdt)
{
u32 fdt_size;
int root_node_off;
- const char *compatible = NULL;
+ const char *compatible;
- fdt_size = fdt_totalsize(fdt);
root_node_off = fdt_path_offset(fdt, "/");
if (root_node_off < 0) {
printf("Error: Root node not found\n");
- } else {
- compatible = fdt_getprop(fdt, root_node_off, "compatible",
- NULL);
+ return;
}
+ fdt_size = fdt_totalsize(fdt);
+ compatible = fdt_getprop(fdt, root_node_off, "compatible",
+ NULL);
+
printf(" (FDT)size = %d\n", fdt_size);
printf(" (FDT)compatible = %s\n",
compatible ? compatible : "(unknown)");