static void config_entry_bump_counters(ConfigEntry *entry, EFI_FILE *root_dir) {
_cleanup_free_ char16_t* old_path = NULL, *new_path = NULL;
_cleanup_(file_closep) EFI_FILE *handle = NULL;
- _cleanup_freepool_ EFI_FILE_INFO *file_info = NULL;
+ _cleanup_free_ EFI_FILE_INFO *file_info = NULL;
UINTN file_info_size;
EFI_STATUS err;
const char16_t *loaded_image_path) {
_cleanup_(file_closep) EFI_FILE *entries_dir = NULL;
- _cleanup_freepool_ EFI_FILE_INFO *f = NULL;
+ _cleanup_free_ EFI_FILE_INFO *f = NULL;
UINTN f_size = 0;
EFI_STATUS err;
static void config_entry_add_osx(Config *config) {
EFI_STATUS err;
UINTN n_handles = 0;
- _cleanup_freepool_ EFI_HANDLE *handles = NULL;
+ _cleanup_free_ EFI_HANDLE *handles = NULL;
assert(config);
}
static EFI_STATUS boot_windows_bitlocker(void) {
- _cleanup_freepool_ EFI_HANDLE *handles = NULL;
+ _cleanup_free_ EFI_HANDLE *handles = NULL;
UINTN n_handles;
EFI_STATUS err;
if (!found)
return EFI_NOT_FOUND;
- _cleanup_freepool_ uint16_t *boot_order = NULL;
+ _cleanup_free_ uint16_t *boot_order = NULL;
UINTN boot_order_size;
/* There can be gaps in Boot#### entries. Instead of iterating over the full
EFI_FILE *root_dir) {
_cleanup_(file_closep) EFI_FILE *linux_dir = NULL;
- _cleanup_freepool_ EFI_FILE_INFO *f = NULL;
+ _cleanup_free_ EFI_FILE_INFO *f = NULL;
UINTN f_size = 0;
EFI_STATUS err;
EFI_STATUS err;
UINTN size = 0;
- _cleanup_freepool_ uint8_t *initrd = NULL;
+ _cleanup_free_ uint8_t *initrd = NULL;
STRV_FOREACH(i, entry->initrd) {
_cleanup_free_ char16_t *o = options;
if (err != EFI_SUCCESS)
return err;
- _cleanup_freepool_ EFI_FILE_INFO *info = NULL;
+ _cleanup_free_ EFI_FILE_INFO *info = NULL;
err = get_file_info_harder(handle, &info, NULL);
if (err != EFI_SUCCESS)
return err;
_cleanup_(devicetree_cleanup) struct devicetree_state dtstate = {};
_cleanup_(unload_imagep) EFI_HANDLE image = NULL;
- _cleanup_freepool_ EFI_DEVICE_PATH *path = NULL;
+ _cleanup_free_ EFI_DEVICE_PATH *path = NULL;
EFI_STATUS err;
assert(entry);
return log_error_status_stall(err, L"Error making file device path: %r", err);
UINTN initrd_size = 0;
- _cleanup_freepool_ void *initrd = NULL;
+ _cleanup_free_ void *initrd = NULL;
_cleanup_free_ char16_t *options_initrd = NULL;
err = initrd_prepare(image_root, entry, &options_initrd, &initrd, &initrd_size);
if (err != EFI_SUCCESS)
_cleanup_(file_closep) EFI_FILE *root = NULL, *extra_dir = NULL;
UINTN dirent_size = 0, buffer_size = 0, n_items = 0, n_allocated = 0;
_cleanup_free_ char16_t *rel_dropin_dir = NULL;
- _cleanup_freepool_ EFI_FILE_INFO *dirent = NULL;
+ _cleanup_free_ EFI_FILE_INFO *dirent = NULL;
_cleanup_(strv_freep) char16_t **items = NULL;
- _cleanup_freepool_ void *buffer = NULL;
+ _cleanup_free_ void *buffer = NULL;
uint32_t inode = 1; /* inode counter, so that each item gets a new inode */
EFI_STATUS err;
EFI_STATUS devicetree_install(struct devicetree_state *state, EFI_FILE *root_dir, char16_t *name) {
_cleanup_(file_closep) EFI_FILE *handle = NULL;
- _cleanup_freepool_ EFI_FILE_INFO *info = NULL;
+ _cleanup_free_ EFI_FILE_INFO *info = NULL;
UINTN len;
EFI_STATUS err;
const char16_t *fname) {
_cleanup_(unload_imagep) EFI_HANDLE image = NULL;
- _cleanup_freepool_ EFI_DEVICE_PATH *path = NULL;
+ _cleanup_free_ EFI_DEVICE_PATH *path = NULL;
_cleanup_free_ char16_t *spath = NULL;
EFI_STATUS err;
}
static EFI_STATUS reconnect(void) {
- _cleanup_freepool_ EFI_HANDLE *handles = NULL;
+ _cleanup_free_ EFI_HANDLE *handles = NULL;
UINTN n_handles = 0;
EFI_STATUS err;
EFI_FILE *root_dir) {
_cleanup_(file_closep) EFI_FILE *drivers_dir = NULL;
- _cleanup_freepool_ EFI_FILE_INFO *dirent = NULL;
+ _cleanup_free_ EFI_FILE_INFO *dirent = NULL;
UINTN dirent_size = 0, n_succeeded = 0;
EFI_STATUS err;
UINTN buffer_size,
const char16_t *description) {
- _cleanup_freepool_ TCG_PCR_EVENT *tcg_event = NULL;
+ _cleanup_free_ TCG_PCR_EVENT *tcg_event = NULL;
EFI_PHYSICAL_ADDRESS event_log_last;
uint32_t event_number = 1;
UINTN desc_len;
uint64_t buffer_size,
const char16_t *description) {
- _cleanup_freepool_ EFI_TCG2_EVENT *tcg_event = NULL;
+ _cleanup_free_ EFI_TCG2_EVENT *tcg_event = NULL;
UINTN desc_len;
assert(tcg);
const char * const sections[],
UINTN *offsets,
UINTN *sizes) {
- _cleanup_freepool_ PeSectionHeader *section_table = NULL;
+ _cleanup_free_ PeSectionHeader *section_table = NULL;
_cleanup_(file_closep) EFI_FILE *handle = NULL;
DosFileHeader dos;
PeFileHeader pe;
#define HASH_VALUE_SIZE 32
static EFI_STATUS acquire_rng(UINTN size, void **ret) {
- _cleanup_freepool_ void *data = NULL;
+ _cleanup_free_ void *data = NULL;
EFI_RNG_PROTOCOL *rng;
EFI_STATUS err;
UINTN n,
void **ret) {
- _cleanup_freepool_ void *output = NULL;
+ _cleanup_free_ void *output = NULL;
assert(old_seed);
assert(system_token_size == 0 || system_token);
void **ret_new_seed,
void **ret_for_kernel) {
- _cleanup_freepool_ void *new_seed = NULL, *for_kernel = NULL;
+ _cleanup_free_ void *new_seed = NULL, *for_kernel = NULL;
EFI_STATUS err;
UINTN n;
}
EFI_STATUS process_random_seed(EFI_FILE *root_dir, RandomSeedMode mode) {
- _cleanup_freepool_ void *seed = NULL, *new_seed = NULL, *rng = NULL, *for_kernel = NULL, *system_token = NULL;
+ _cleanup_free_ void *seed = NULL, *new_seed = NULL, *rng = NULL, *for_kernel = NULL, *system_token = NULL;
_cleanup_(file_closep) EFI_FILE *handle = NULL;
UINTN size, rsize, wsize, system_token_size = 0;
- _cleanup_freepool_ EFI_FILE_INFO *info = NULL;
+ _cleanup_free_ EFI_FILE_INFO *info = NULL;
uint64_t uefi_monotonic_counter = 0;
EFI_STATUS err;
struct bmp_dib *dib;
struct bmp_map *map;
const uint8_t *pixmap;
- _cleanup_freepool_ void *blt = NULL;
+ _cleanup_free_ void *blt = NULL;
UINTN x_pos = 0;
UINTN y_pos = 0;
EFI_STATUS err;
UINTN cmdline_len = 0, linux_size, initrd_size, dt_size;
UINTN credential_initrd_size = 0, global_credential_initrd_size = 0, sysext_initrd_size = 0;
- _cleanup_freepool_ void *credential_initrd = NULL, *global_credential_initrd = NULL;
- _cleanup_freepool_ void *sysext_initrd = NULL;
+ _cleanup_free_ void *credential_initrd = NULL, *global_credential_initrd = NULL;
+ _cleanup_free_ void *sysext_initrd = NULL;
EFI_PHYSICAL_ADDRESS linux_base, initrd_base, dt_base;
_cleanup_(devicetree_cleanup) struct devicetree_state dt_state = {};
EFI_LOADED_IMAGE_PROTOCOL *loaded_image;
return err;
if (size == 0) {
- _cleanup_freepool_ EFI_FILE_INFO *info = NULL;
+ _cleanup_free_ EFI_FILE_INFO *info = NULL;
err = get_file_info_harder(handle, &info, NULL);
if (err != EFI_SUCCESS)
UINTN *ret_size) {
UINTN size = offsetof(EFI_FILE_INFO, FileName) + 256;
- _cleanup_freepool_ EFI_FILE_INFO *fi = NULL;
+ _cleanup_free_ EFI_FILE_INFO *fi = NULL;
EFI_STATUS err;
assert(handle);
EFI_FILE **ret) {
_cleanup_(file_closep) EFI_FILE *dir = NULL;
- _cleanup_freepool_ EFI_FILE_INFO *file_info = NULL;
+ _cleanup_free_ EFI_FILE_INFO *file_info = NULL;
EFI_STATUS err;
assert(root);
free(*(void **) p);
}
-#define _cleanup_freepool_ _cleanup_free_
#define _cleanup_free_ _cleanup_(freep)
_malloc_ _alloc_(1) _returns_nonnull_ _warn_unused_result_
EFI_LBA *ret_backup_lba, /* May be changed even on error! */
HARDDRIVE_DEVICE_PATH *ret_hd) {
- _cleanup_freepool_ EFI_PARTITION_ENTRY *entries = NULL;
+ _cleanup_free_ EFI_PARTITION_ENTRY *entries = NULL;
union GptHeaderBuffer gpt;
EFI_STATUS err;
uint32_t crc32;
return EFI_NOT_FOUND;
/* Chop off the partition part, leaving us with the full path to the disk itself. */
- _cleanup_freepool_ EFI_DEVICE_PATH *disk_path = NULL;
+ _cleanup_free_ EFI_DEVICE_PATH *disk_path = NULL;
EFI_DEVICE_PATH *p = disk_path = path_chop(partition_path, part_node);
EFI_HANDLE disk_handle;
}
EFI_STATUS xbootldr_open(EFI_HANDLE *device, EFI_HANDLE *ret_device, EFI_FILE **ret_root_dir) {
- _cleanup_freepool_ EFI_DEVICE_PATH *partition_path = NULL;
+ _cleanup_free_ EFI_DEVICE_PATH *partition_path = NULL;
EFI_HANDLE new_device;
EFI_FILE *root_dir;
EFI_STATUS err;