]> git.dujemihanovic.xyz Git - u-boot.git/commit
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)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 21 Jan 2024 10:24:24 +0000 (11:24 +0100)
commit0351b659dd0283062d91ab0dd752887bedd53278
treed81b76e8ea32316f38cf436c574cdebf4e380ccc
parentf674a2f9a9f9c28fddde53f0a0b2f3e3c3b342ee
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>
lib/efi_loader/efi_disk.c