[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>
Fri, 19 Apr 2024 18:32:03 +0000 (11:32 -0700)
commit82fcc1736313f874c6154b821851d04a36bf73e8
tree8a2f1e27984bcea14afbf4aedfdf6ec33c01ac24
parentc65185d40ef4d1f9ccb8dc80c8d84d033d4735d4
[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