summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2007-05-04 10:02:33 +0200
committerWolfgang Denk <wd@denx.de>2007-05-04 10:02:33 +0200
commit9877d7dcd1eebe61aa5d8b8ffe9c048ea426e6f6 (patch)
treeaa4ed05fb32d63f8e75174aebd607ea83ca39e32
parentc64a89d6ce8584b9fc64f4e85da9ecac3cfc2c2a (diff)
downloadu-boot-imx-9877d7dcd1eebe61aa5d8b8ffe9c048ea426e6f6.zip
u-boot-imx-9877d7dcd1eebe61aa5d8b8ffe9c048ea426e6f6.tar.gz
u-boot-imx-9877d7dcd1eebe61aa5d8b8ffe9c048ea426e6f6.tar.bz2
Fix initrd length corruption in bootm command.
When using FDT Images, the length of an inital ramdisk was overwritten (bug introduced by commit 87a449c8, 22 Aug 2006). Patches by Timur Tabi & Johns Daniel. Signed-off-by: Wolfgang Denk <wd@denx.de>
-rw-r--r--common/cmd_bootm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 32c29e5..a6499e8 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -779,9 +779,8 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
checksum = ntohl(hdr->ih_dcrc);
addr = (ulong)((uchar *)(hdr) + sizeof(image_header_t));
- len = ntohl(hdr->ih_size);
- if(checksum != crc32(0, (uchar *)addr, len)) {
+ if(checksum != crc32(0, (uchar *)addr, ntohl(hdr->ih_size))) {
printf("ERROR: Flat Device Tree checksum is invalid\n");
return;
}