1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +02:00

eficonfig: carve out efi_get_next_variable_name_int calls

To retrieve the EFI variable name by efi_get_next_variable_name_int(),
the sequence of alloc -> efi_get_next_variable_name_int ->
realloc -> efi_get_next_variable_name_int is required.
In current code, this sequence repeatedly appears in
the several functions. It should be curved out a common function.

This commit also fixes the missing free() of var_name16
in eficonfig_delete_invalid_boot_option().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Masahisa Kojima
2022-12-19 11:33:12 +09:00
committed by Heinrich Schuchardt
parent f823e32388
commit ce3270849b
3 changed files with 51 additions and 47 deletions

View File

@@ -708,6 +708,8 @@ int algo_to_len(const char *algo);
int efi_link_dev(efi_handle_t handle, struct udevice *dev);
int efi_unlink_dev(efi_handle_t handle);
bool efi_varname_is_load_option(u16 *var_name16, int *index);
efi_status_t efi_next_variable_name(efi_uintn_t *size, u16 **buf,
efi_guid_t *guid);
/**
* efi_size_in_pages() - convert size in bytes to size in pages