[PATCH 2/2] efi_loader: create common function to free struct efi_disk_obj
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Fri, 19 Jan 2024 00:45:45 +0000 (09:45 +0900)
committerVagrant Cascadian <vagrant@debian.org>
Thu, 9 Jan 2025 19:14:04 +0000 (11:14 -0800)
commit5eadb4eefaa060d19f8b6b893507635a6b0928c1
treeaeeb857b5f20e4da62a57acb63c85e1ea413e890
parent8638c755b8935e2392bb79870b1392290b23fec0
[PATCH 2/2] efi_loader: create common function to free struct efi_disk_obj

Current error handling of creating raw disk/partition has
following issues.
 - duplicate free for EFI handle, EFI handle is already freed
   in efi_delete_handle()
 - missing free for struct efi_device_path and
   struct efi_simple_file_system_protocol in some error paths

To address those issues, this commit creates the common function
to free the struct efi_disk_obj resources and calls it in case
of error.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Gbp-Pq: Topic riscv64
Gbp-Pq: Name efi_loader-create-common-function-to-free-struct-efi.patch
lib/efi_loader/efi_disk.c