cmd: replace efi_create_handle/add_protocol with InstallMultipleProtocol
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Thu, 6 Oct 2022 13:08:44 +0000 (16:08 +0300)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 6 Oct 2022 20:54:58 +0000 (22:54 +0200)
commita75e8355eaa561ebd6128c92a90288d5d7c1f060
treedd64567f7dee81a24da8d6b66daa84230d262fb9
parent05c4c9e21ae6f45ba1091917fc55f3ebc3916909
cmd: replace efi_create_handle/add_protocol with InstallMultipleProtocol

In general handles should only be deleted if the last remaining protocol
is removed.  Instead of explicitly calling
efi_create_handle -> efi_add_protocol -> efi_delete_handle which blindly
removes all protocols from a handle before removing it,  use
InstallMultiple/UninstallMultiple which adheres to the EFI spec and only
deletes a handle if there are no additional protocols present

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
cmd/bootefi.c