summaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-23 21:29:25 -0700
committerSimon Glass <sjg@chromium.org>2018-12-05 06:01:34 -0700
commit12efc933b9e69f7340703655d84b9b610fa42fd4 (patch)
tree3e0d0be9f820ce26d6da65c681c634e14aaaba32 /arch/sandbox
parent6b5e420137b42f3c23669b07a7b0c6ff5502fcb9 (diff)
sandbox: Check the filename in jump_to_image_no_args()
If the filename is NULL this function currently crashes. Update it to fail gracefully. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/cpu/spl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 5005ed2f54..2ca4cd6e35 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -69,7 +69,11 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
{
const char *fname = spl_image->arg;
- os_fd_restore();
- os_spl_to_uboot(fname);
+ if (fname) {
+ os_fd_restore();
+ os_spl_to_uboot(fname);
+ } else {
+ printf("No filename provided for U-Boot\n");
+ }
hang();
}