diff options
author | Simon Glass <sjg@chromium.org> | 2024-11-15 16:19:18 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-01-15 08:48:42 -0600 |
commit | ea7f88f313270e2bfef5f4f91dfb34f86f90c675 (patch) | |
tree | 2b0559322c365bf79937ad5f74094afe302b8457 /boot/bootmeth_efi.c | |
parent | aa0ba7fbda4121fa9f3f11161fb4ebdd7e227299 (diff) |
bootmeth_efi: Check the filename-allocation in the network path
If the filename cannot be set we should give up. Add the missing error
check.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/bootmeth_efi.c')
-rw-r--r-- | boot/bootmeth_efi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index f711b9d0598..a2998452666 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -252,6 +252,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), |