[U-Boot] [PATCH] Prevent a U-Boot crash on Wandboard
Wolfgang Denk
wd at denx.de
Mon Sep 23 20:45:21 CEST 2013
Dear Steven Falco,
In message <523F979C.1070205 at gmail.com> you 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.
...
> - printf("Wrong Image Format for %s command\n", cmdtp->name);
> + if (cmdtp)
> + printf("Wrong Image Format for %s command\n", cmdtp->name);
> + else
> + printf("Wrong Image Format for command\n");
This is the wrong way to fix it. Instead of handling this here,
please fix the place where a NULL pointer is passed incorrectly.
Also, the error message "Wrong Image Format for command" makes no
sense and gives no help to the user to understand what's wrong.
NAK.
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
Never worry about theory as long as the machinery does what it's
supposed to do. - R. A. Heinlein
More information about the U-Boot
mailing list