[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, 2 Jan 2025 21:47:07 +0000 (13:47 -0800)
commitcf7b97e2dc71464f7a5eeeaf0d9aa1beb2f2e248
treedca553c283f62a1788ed7fa35257c10ef1061b1f
parent6e42c3c48d95a016c0d5b2402e8b796df105cc5f
[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