From: Jan Janssen Date: Tue, 12 Jul 2022 07:48:38 +0000 (+0200) Subject: boot: Remove _cleanup_freepool_ X-Git-Tag: v252-rc1~675^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93521e55e512a9717f3034f8be033c43f965b87e;p=thirdparty%2Fsystemd.git boot: Remove _cleanup_freepool_ --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 3587033dd32..ece1c11cd5e 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -1328,7 +1328,7 @@ static void config_entry_parse_tries( 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; @@ -1575,7 +1575,7 @@ static void config_load_entries( 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; @@ -1886,7 +1886,7 @@ static ConfigEntry *config_entry_add_loader_auto( 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); @@ -1917,7 +1917,7 @@ static void config_entry_add_osx(Config *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; @@ -1955,7 +1955,7 @@ static EFI_STATUS boot_windows_bitlocker(void) { 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 @@ -2031,7 +2031,7 @@ static void config_entry_add_unified( 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; @@ -2238,7 +2238,7 @@ static EFI_STATUS initrd_prepare( 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; @@ -2252,7 +2252,7 @@ static EFI_STATUS initrd_prepare( 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; @@ -2288,7 +2288,7 @@ static EFI_STATUS image_start( _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); @@ -2307,7 +2307,7 @@ static EFI_STATUS image_start( 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) diff --git a/src/boot/efi/cpio.c b/src/boot/efi/cpio.c index ceeb07009d3..ad469af034d 100644 --- a/src/boot/efi/cpio.c +++ b/src/boot/efi/cpio.c @@ -320,9 +320,9 @@ EFI_STATUS pack_cpio( _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; diff --git a/src/boot/efi/devicetree.c b/src/boot/efi/devicetree.c index 9640ed608fa..03126706135 100644 --- a/src/boot/efi/devicetree.c +++ b/src/boot/efi/devicetree.c @@ -73,7 +73,7 @@ static EFI_STATUS devicetree_fixup(struct devicetree_state *state, UINTN len) { 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; diff --git a/src/boot/efi/drivers.c b/src/boot/efi/drivers.c index 751a09a462a..41f0326af1c 100644 --- a/src/boot/efi/drivers.c +++ b/src/boot/efi/drivers.c @@ -12,7 +12,7 @@ static EFI_STATUS load_one_driver( 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; @@ -51,7 +51,7 @@ static EFI_STATUS load_one_driver( } static EFI_STATUS reconnect(void) { - _cleanup_freepool_ EFI_HANDLE *handles = NULL; + _cleanup_free_ EFI_HANDLE *handles = NULL; UINTN n_handles = 0; EFI_STATUS err; @@ -78,7 +78,7 @@ EFI_STATUS load_drivers( 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; diff --git a/src/boot/efi/measure.c b/src/boot/efi/measure.c index 575a3ceb558..71085546818 100644 --- a/src/boot/efi/measure.c +++ b/src/boot/efi/measure.c @@ -17,7 +17,7 @@ static EFI_STATUS tpm1_measure_to_pcr_and_event_log( 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; @@ -51,7 +51,7 @@ static EFI_STATUS tpm2_measure_to_pcr_and_event_log( 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); diff --git a/src/boot/efi/pe.c b/src/boot/efi/pe.c index 32ac49d1e25..8d7061d55b2 100644 --- a/src/boot/efi/pe.c +++ b/src/boot/efi/pe.c @@ -282,7 +282,7 @@ EFI_STATUS pe_file_locate_sections( 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; diff --git a/src/boot/efi/random-seed.c b/src/boot/efi/random-seed.c index 598c9b0500f..652634bdc9b 100644 --- a/src/boot/efi/random-seed.c +++ b/src/boot/efi/random-seed.c @@ -18,7 +18,7 @@ #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; @@ -90,7 +90,7 @@ static EFI_STATUS hash_many( UINTN n, void **ret) { - _cleanup_freepool_ void *output = NULL; + _cleanup_free_ void *output = NULL; assert(old_seed); assert(system_token_size == 0 || system_token); @@ -122,7 +122,7 @@ static EFI_STATUS mangle_random_seed( 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; @@ -230,10 +230,10 @@ static void validate_sha256(void) { } 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; diff --git a/src/boot/efi/splash.c b/src/boot/efi/splash.c index 11a02b52d5e..1f805cf9834 100644 --- a/src/boot/efi/splash.c +++ b/src/boot/efi/splash.c @@ -260,7 +260,7 @@ EFI_STATUS graphics_splash(const uint8_t *content, UINTN len, const EFI_GRAPHICS 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; diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index de594a54784..2acd5e57385 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -169,8 +169,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { 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; diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c index 44a75e1c324..7603eb8f534 100644 --- a/src/boot/efi/util.c +++ b/src/boot/efi/util.c @@ -378,7 +378,7 @@ EFI_STATUS file_read(EFI_FILE *dir, const char16_t *name, UINTN off, UINTN size, 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) @@ -483,7 +483,7 @@ EFI_STATUS get_file_info_harder( 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); @@ -585,7 +585,7 @@ EFI_STATUS open_directory( 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); diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index 2cfcda7c622..4de799ea0e4 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -41,7 +41,6 @@ static inline void freep(void *p) { free(*(void **) p); } -#define _cleanup_freepool_ _cleanup_free_ #define _cleanup_free_ _cleanup_(freep) _malloc_ _alloc_(1) _returns_nonnull_ _warn_unused_result_ diff --git a/src/boot/efi/xbootldr.c b/src/boot/efi/xbootldr.c index 5db689b65ff..3ccf9fa8b1c 100644 --- a/src/boot/efi/xbootldr.c +++ b/src/boot/efi/xbootldr.c @@ -90,7 +90,7 @@ static EFI_STATUS try_gpt( 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; @@ -191,7 +191,7 @@ static EFI_STATUS find_device(EFI_HANDLE *device, EFI_DEVICE_PATH **ret_device_p 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; @@ -254,7 +254,7 @@ static EFI_STATUS find_device(EFI_HANDLE *device, EFI_DEVICE_PATH **ret_device_p } 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;