[PATCH 1/2] bootm: Fix check for ret-value

Steffen Trumtrar s.trumtrar at pengutronix.de
Wed Apr 18 05:09:19 EDT 2012


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

Signed-off-by: Steffen Trumtrar <s.trumtrar at 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




More information about the barebox mailing list