mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
cmd: sysboot: null check filename
Currently if ${bootfile} is unset and sysboot is invoked with no
filename specified then U-Boot will crash will a null-pointer
dereference. Add the missing check and a matching error print.
Fixes: 993c912d304d ("cmd: sysboot: Create a sysboot command dedicated file")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
This commit is contained in:
parent
4b36f01201
commit
ae8e1d5aa4
@ -77,6 +77,10 @@ static int do_sysboot(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
|
||||
if (argc < 6) {
|
||||
filename = env_get("bootfile");
|
||||
if (!filename) {
|
||||
printf("Specify a filename or set the ${bootfile} environment variable\n");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
filename = argv[5];
|
||||
env_set("bootfile", filename);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user