From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix initrd length miscalculation in bootm command
Date: Tue, 27 Mar 2007 11:30:28 -0500 [thread overview]
Message-ID: <460946A4.9070903@freescale.com> (raw)
In-Reply-To: <ba5d9360703270925q681f1cb5h1a3be712b4529f@mail.gmail.com>
Johns Daniel wrote:
> One more note to add to that. The only part of Timur's patch that is
> really important is this bit:
> @@ -771,9 +767,8 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int fl
>
> 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;
> }
>
> The "len" variable should not be used for the DTB image.
One of the goals of my patch is to make it very clear what 'len' is supposed to be. It is
only supposed to be the initrd length. Calling it 'len' is what confused the programmer
who added the OF code. He saw 'len' and thought it was a scratch variable.
--
Timur Tabi
Linux Kernel Developer @ Freescale
prev parent reply other threads:[~2007-03-27 16:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-05 19:39 [U-Boot-Users] [PATCH] Fix initrd length miscalculation in bootm command Timur Tabi
2007-02-06 0:43 ` Wolfgang Denk
2007-02-06 15:11 ` Timur Tabi
2007-02-06 17:07 ` Kumar Gala
2007-02-06 17:11 ` Timur Tabi
2007-02-06 17:14 ` Kumar Gala
2007-02-06 17:17 ` Timur Tabi
2007-02-19 23:51 ` Timur Tabi
2007-02-20 16:14 ` Kumar Gala
2007-02-20 16:36 ` Timur Tabi
2007-02-20 19:06 ` Wolfgang Denk
2007-02-20 19:19 ` Timur Tabi
2007-02-20 23:05 ` Timur Tabi
2007-02-26 13:10 ` Wolfgang Denk
2007-02-26 16:15 ` Timur Tabi
2007-02-27 16:48 ` Timur Tabi
2007-02-27 20:55 ` Wolfgang Denk
2007-02-27 22:13 ` Timur Tabi
2007-03-16 21:49 ` Timur Tabi
2007-03-23 22:44 ` Johns Daniel
2007-03-27 16:25 ` Johns Daniel
2007-03-27 16:30 ` Timur Tabi [this message]
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=460946A4.9070903@freescale.com \
--to=timur@freescale.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