mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
If the environment does not have "soc" or "board" set, and fdtdir option is specified in extlinux.conf, the bootloader will crash whilst dereferencing a null pointer. Add a guard against null soc or board. Fixes a crash of qemu-riscv64_smode configuration, which does not have CONFIG_SYS_SOC defined. Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
This commit is contained in:
parent
82a3c9ef20
commit
75efe7dc99
1 changed files with 8 additions and 0 deletions
|
@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
|||
f2 = "-";
|
||||
f3 = env_get("board");
|
||||
f4 = ".dtb";
|
||||
if (!f1) {
|
||||
f1 = "";
|
||||
f2 = "";
|
||||
}
|
||||
if (!f3) {
|
||||
f2 = "";
|
||||
f3 = "";
|
||||
}
|
||||
}
|
||||
|
||||
len = strlen(label->fdtdir);
|
||||
|
|
Loading…
Reference in a new issue