U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] common: Fix source command on 64-bit architectures
Date: Fri, 20 Mar 2015 12:53:42 +0100	[thread overview]
Message-ID: <1426852422-16630-1-git-send-email-thierry.reding@gmail.com> (raw)

From: Thierry Reding <treding@nvidia.com>

The source command uses an unsigned long to iterate over the 32-bit
lengths array contained in the legacy image format. On architectures
where unsigned long is 64-bit this fails to find the correct entry
point of a script.

Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 common/cmd_source.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/cmd_source.c b/common/cmd_source.c
index 6881bc9ddd33..5f550a525430 100644
--- a/common/cmd_source.c
+++ b/common/cmd_source.c
@@ -32,7 +32,7 @@ source (ulong addr, const char *fit_uname)
 #if defined(CONFIG_IMAGE_FORMAT_LEGACY)
 	const image_header_t *hdr;
 #endif
-	ulong		*data;
+	u32		*data;
 	int		verify;
 	void *buf;
 #if defined(CONFIG_FIT)
@@ -73,7 +73,7 @@ source (ulong addr, const char *fit_uname)
 		}
 
 		/* get length of script */
-		data = (ulong *)image_get_data (hdr);
+		data = (u32 *)image_get_data (hdr);
 
 		if ((len = uimage_to_cpu (*data)) == 0) {
 			puts ("Empty Script\n");
-- 
2.3.2

             reply	other threads:[~2015-03-20 11:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 11:53 Thierry Reding [this message]
2015-03-28 16:02 ` [U-Boot] common: Fix source command on 64-bit architectures Tom Rini

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=1426852422-16630-1-git-send-email-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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