diff options
author | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2023-06-19 14:14:02 +0300 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2023-07-20 09:12:50 +0200 |
commit | 4a3baf9da6f721ada4d603a1d1d20c491a54d609 (patch) | |
tree | befd5bb708e896819e287ff28c2274018ecd880c /lib | |
parent | 6287021ff9143718310075c414e535f1679a3929 (diff) | |
download | u-boot-4a3baf9da6f721ada4d603a1d1d20c491a54d609.tar.gz u-boot-4a3baf9da6f721ada4d603a1d1d20c491a54d609.tar.bz2 u-boot-4a3baf9da6f721ada4d603a1d1d20c491a54d609.zip |
efi_loader: use efi_install_multiple_protocol_interfaces()
The TCG2 protocol currently adds and removes protocols with
efi_(add/remove)_protocol().
Removing protocols with efi_remove_protocol() might prove
problematic since it doesn't call DisconnectController() when
uninstalling the protocol and does not comply with the UEFI specification.
It's also beneficial for readability to have protocol installations and
removals in pairs -- IOW when efi_install_multiple_protocol_interfaces()
is called, efi_uninstall_multiple_protocol_interfaces() should be used to
remove it. So let's swap the efi_add_protocol() as well.
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_tcg2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index a83ae7a46c..49f8a5e77c 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -1680,8 +1680,8 @@ void tcg2_uninit(void) if (!is_tcg2_protocol_installed()) return; - ret = efi_remove_protocol(efi_root, &efi_guid_tcg2_protocol, - (void *)&efi_tcg2_protocol); + ret = efi_uninstall_multiple_protocol_interfaces(efi_root, &efi_guid_tcg2_protocol, + &efi_tcg2_protocol, NULL); if (ret != EFI_SUCCESS) log_err("Failed to remove EFI TCG2 protocol\n"); } @@ -2507,8 +2507,8 @@ efi_status_t efi_tcg2_register(void) goto fail; } - ret = efi_add_protocol(efi_root, &efi_guid_tcg2_protocol, - (void *)&efi_tcg2_protocol); + ret = efi_install_multiple_protocol_interfaces(&efi_root, &efi_guid_tcg2_protocol, + &efi_tcg2_protocol, NULL); if (ret != EFI_SUCCESS) { tcg2_uninit(); goto fail; |