aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Salveti de Araujo <ricardo.salveti@linaro.org>2011-07-11 01:37:45 -0300
committerJohn Rigby <john.rigby@linaro.org>2011-08-15 15:24:23 -0600
commit2f84e8ec3a1f25b9c93501d2d75560988c62f4b3 (patch)
tree19577287aacf479dc3952b9fa2034ddf70153493
parent324688f1788a4b9a7ecf738c065ddcde2e9a7b95 (diff)
downloadu-boot-linaro-stable-2f84e8ec3a1f25b9c93501d2d75560988c62f4b3.tar.gz
cmd_pxecfg: only call do_bootm with argc == 4 if fdtaddr != NULL
Otherwise if you build with CONFIG_OF_LIBFDT, you'll get a segmentation fault at boot_get_fdt, as it expects argv[3] to be valid if argc == 4. Patch forwarded to jason.hobbs@calxeda.com and john.rigby@linaro.org. Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
-rw-r--r--common/cmd_pxecfg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/cmd_pxecfg.c b/common/cmd_pxecfg.c
index b34ac39dc..ee1b66b86 100644
--- a/common/cmd_pxecfg.c
+++ b/common/cmd_pxecfg.c
@@ -430,7 +430,10 @@ static void label_boot(struct pxecfg_label *label)
*/
bootm_argv[3] = getenv("fdtaddr");
- do_bootm(NULL, 0, 4, bootm_argv);
+ if (bootm_argv[3])
+ do_bootm(NULL, 0, 4, bootm_argv);
+ else
+ do_bootm(NULL, 0, 3, bootm_argv);
}
enum token_type {