Message ID | 20190805171103.15564-1-semen.protsenko@linaro.org |
---|---|
State | Accepted |
Commit | 24434adbd1c73b59bff3c42691e26cc52cdb262a |
Delegated to: | Tom Rini |
Headers | show |
Series | [U-Boot] common: image-android-dt: Fix logic in print fdt info routine | expand |
On Mon, Aug 05, 2019 at 08:11:03PM +0300, Sam Protsenko wrote: > Do not attempt to print fdt info if root node wasn't found. > > Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Applied to u-boot/master, thanks!
diff --git a/common/image-android-dt.c b/common/image-android-dt.c index 6916826179..a2d52df4a2 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)");
Do not attempt to print fdt info if root node wasn't found. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> --- common/image-android-dt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)