From: Simon Glass Date: Sat, 24 Nov 2018 04:29:25 +0000 (-0700) Subject: sandbox: Check the filename in jump_to_image_no_args() X-Git-Tag: baikal/mips/sdk5.9~1230^2~30 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=5581356133065ad878f4f5e345e0499ca91dac56;p=uboot.git 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 --- 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(); }