[U-Boot] [PATCH] Prevent a U-Boot crash on Wandboard

Wolfgang Denk wd at denx.de
Mon Sep 23 22:43:22 CEST 2013


Dear Tom,

In message <20130923191757.GZ5273 at bill-the-cat> you wrote:
> 
> > I don't know if it's only Wandboard, or if other boards are affected,
> > too (which are these? under which exact test cases?).  In any case.
> > the problem is not here, but on the caller's side.  It should not call
> > a function which expects a command name with a NULL pointer passed as
> > argument.
> 
> I looked around at this a bit this morning.  cmd_pxe.c would need a lot
> of mangling to pass around cmdtp, just for the sake of an error message
> that's then ignored as the caller logic is:
> 1) Try bootm on the image
> 2) If CONFIG_CMD_BOOTZ, if bootm returned, maybe we got a zImage?
> do_bootz instead (also NULL cmdtp).
> 
> The error message wouldn't exactly make sense here either, being invoked
> via menu.

To me that meens that the whole logic needs rework.  We should never
just "try out" if an image is in uImage format or a zImage - we are
perfectly able to detect such information from the file header (in
case of uImage at least).

If we keep the code as is, what's wrong then with using the pxe
command as ID string?  Then the end user knows at least that it was
this command which was failing (or producing the message).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Plan to throw one away. You will anyway."
                              - Fred Brooks, "The Mythical Man Month"


More information about the U-Boot mailing list