Skip to content

Commit

Permalink
bootmeth_efi: Check the filename-allocation in the network path
Browse files Browse the repository at this point in the history
If the filename cannot be set we should give up. Add the missing error
check.

Signed-off-by: Simon Glass <sjg@chromium.org>
  • Loading branch information
sjg20 authored and trini committed Jan 15, 2025
1 parent aa0ba7f commit ea7f88f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boot/bootmeth_efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit ea7f88f

Please sign in to comment.