All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] common: image-android-dt: Fix logic in print fdt info routine
@ 2019-08-05 17:11 Sam Protsenko
  2019-08-08  3:16 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Sam Protsenko @ 2019-08-05 17:11 UTC (permalink / raw)
  To: u-boot

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(-)

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)");
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] common: image-android-dt: Fix logic in print fdt info routine
  2019-08-05 17:11 [U-Boot] [PATCH] common: image-android-dt: Fix logic in print fdt info routine Sam Protsenko
@ 2019-08-08  3:16 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-08-08  3:16 UTC (permalink / raw)
  To: u-boot

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!

-- 
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-08  3:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 17:11 [U-Boot] [PATCH] common: image-android-dt: Fix logic in print fdt info routine Sam Protsenko
2019-08-08  3:16 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.