Skip to contentSkip to conversation

common: image-android-dt: Fix logic in print fdt info routine

PATCH New Sam Protsenko 2 participants 2 messages Aug 5, 2019 – Aug 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common: image-android-dt: Fix logic in print fdt info routine

Do not attempt to print fdt info if root node wasn't found.

---
 common/image-android-dt.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
common/image-android-dt.c +6 -5
index 6916826179..a2d52df4a2 100644
@@ -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)");
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 common: image-android-dt: Fix logic in print fdt info routine

Quoted 3 lines · Sam Protsenko

Do not attempt to print fdt info if root node wasn't found.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190807/a3605a84/attachment.sig>