mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH 1/2] bootm: Fix check for ret-value
Date: Wed, 18 Apr 2012 11:09:19 +0200	[thread overview]
Message-ID: <1334740160-19918-2-git-send-email-s.trumtrar@pengutronix.de> (raw)
In-Reply-To: <1334740160-19918-1-git-send-email-s.trumtrar@pengutronix.de>

The intention of this code was to check the return value of fdt_open_into. Fix
this.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 commands/bootm.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/commands/bootm.c b/commands/bootm.c
index 1e1dc52..4f4cbb3 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -202,10 +202,9 @@ static int bootm_open_oftree(struct image_data *data, char *oftree, int num)
 	}
 
 	fdt = xrealloc(fdt, size + 0x8000);
-	fdt_open_into(fdt, fdt, size + 0x8000);
-
-	if (!fdt) {
-		printf("unable to read %s\n", oftree);
+	ret = fdt_open_into(fdt, fdt, size + 0x8000);
+	if (ret) {
+		printf("unable to parse %s\n", oftree);
 		return -ENODEV;
 	}
 
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-04-18  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18  9:09 bootm fixes Steffen Trumtrar
2012-04-18  9:09 ` Steffen Trumtrar [this message]
2012-04-18  9:09 ` [PATCH 2/2] bootm: Align oftree Steffen Trumtrar
2012-04-18 18:38 ` bootm fixes Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334740160-19918-2-git-send-email-s.trumtrar@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox