[PATCH] fix Sascha's patch

Eric Bénard eric at eukrea.com
Wed Oct 13 08:27:19 EDT 2010


Signed-off-by: Eric Bénard <eric at eukrea.com>
---
 commands/bootm.c  |    2 +-
 common/image.c    |    2 +-
 scripts/mkimage.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/commands/bootm.c b/commands/bootm.c
index a7cbfb9..14475c7 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -350,7 +350,7 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[])
 
 	/* loop through the registered handlers */
 	list_for_each_entry(handler, &handler_list, list) {
-		if (image_get_os(hdr) == handler->image_type) {
+		if (image_get_os(os_header) == handler->image_type) {
 			handler->bootm(&data);
 			printf("handler returned!\n");
 			goto err_out;
diff --git a/common/image.c b/common/image.c
index 2b2c410..a4c8b95 100644
--- a/common/image.c
+++ b/common/image.c
@@ -287,7 +287,7 @@ void image_print_contents(const void *ptr)
 	printf ("%sEntry Point:  %08x\n", p, image_get_ep(hdr));
 
 	type = image_get_type(hdr);
-	if (type != IH_TYPE_MULTI || type != IH_TYPE_SCRIPT) {
+	if (type == IH_TYPE_MULTI || type == IH_TYPE_SCRIPT) {
 		int i;
 		ulong data, len;
 		ulong count = image_multi_count(hdr);
diff --git a/scripts/mkimage.c b/scripts/mkimage.c
index f6cbb1c..40a3483 100644
--- a/scripts/mkimage.c
+++ b/scripts/mkimage.c
@@ -224,7 +224,7 @@ NXTARG:		;
 		 */
 		memcpy (hdr, ptr, sizeof(image_header_t));
 
-		if (image_check_magic(hdr)) {
+		if (image_get_magic(hdr) != IH_MAGIC) {
 			fprintf (stderr,
 				"%s: Bad Magic Number: \"%s\" is no valid image\n",
 				cmdname, imagefile);
-- 
1.7.0.4


--------------050808030402020707000403--



More information about the barebox mailing list