From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Prevent a U-Boot crash on Wandboard
Date: Mon, 23 Sep 2013 18:11:58 +0200 [thread overview]
Message-ID: <20130923181158.0c1747f5@lilith> (raw)
In-Reply-To: <523F979C.1070205@gmail.com>
Hi Steven,
On Sun, 22 Sep 2013 21:21:32 -0400, Steven Falco
<stevenfalco@gmail.com> wrote:
> Prevent a crash when PXE boot calls do_bootm with a vmlinuz formatted image.
> In this case, there will be a null cmdtp pointer, and we must not dereference
> it.
>
> Signed-off-by: Steven A. Falco <stevenfalco@gmail.com>
>
> ---
>
> In file cmd_pxe.c around line 687 is a call:
>
> do_bootm(NULL, 0, bootm_argc, bootm_argv);
>
> Notice that the first argument is NULL. Therefore, the cmdtp
> pointer will always be NULL when using the pxe boot mechanism.
>
> do_bootm() eventually calls boot_get_kernel(), still with cmdtp == NULL.
> In the Wandboard case, the vmlinuz binary is not "legacy format", nor is
> it "fit format", so U-Boot attempts to print:
>
> printf("Wrong Image Format for %s command\n", cmdtp->name);
>
> That is doomed to fail, because cmdtp is NULL. The following patch corrects
> the problem; the command name will be printed only if the pointer is valid.
Then shouldn't the patch subject/summary be "print command name only
if cmdtp is not NULL" rather than the quite uninformative "prevent a
crash"?
Amicalement,
--
Albert.
next prev parent reply other threads:[~2013-09-23 16:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-23 1:21 [U-Boot] [PATCH] Prevent a U-Boot crash on Wandboard Steven Falco
2013-09-23 11:40 ` Otavio Salvador
2013-09-23 18:47 ` Wolfgang Denk
2013-09-23 16:11 ` Albert ARIBAUD [this message]
2013-09-23 16:21 ` Fabio Estevam
2013-09-23 18:18 ` Tom Rini
2013-09-23 18:50 ` Wolfgang Denk
2013-09-23 19:17 ` Tom Rini
2013-09-23 19:45 ` Tom Rini
2013-09-23 20:44 ` Wolfgang Denk
2013-09-23 23:23 ` Steven Falco
2013-09-23 20:43 ` Wolfgang Denk
2013-09-23 18:45 ` Wolfgang Denk
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=20130923181158.0c1747f5@lilith \
--to=albert.u.boot@aribaud.net \
--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