
18 Oct
2024
18 Oct
'24
1:24 a.m.
If the filename cannot be set we should give up. Add the missing error check.
Signed-off-by: Simon Glass sjg@chromium.org ---
boot/bootmeth_efi.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index e1e378481b9..548d5f71b2a 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -269,6 +269,8 @@ static int distro_efi_read_bootflow_net(struct bootflow *bflow) if (!bootfile_name) return log_msg_ret("bootfile_name", ret); bflow->fname = strdup(bootfile_name); + if (!bflow->fname) + return log_msg_ret("fi0", -ENOMEM);
/* do the hideous EFI hack */ efi_set_bootdev("Net", "", bflow->fname, map_sysmem(addr, 0),
--
2.34.1