From: Wolfgang Denk Date: Fri, 4 May 2007 08:02:33 +0000 (+0200) Subject: Fix initrd length corruption in bootm command. X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9877d7dcd1eebe61aa5d8b8ffe9c048ea426e6f6;p=project%2Fbcm63xx%2Fu-boot.git 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 --- diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 32c29e55a3..a6499e8dd9 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; }