aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt2023-06-18 09:00:45 +0200
committerHeinrich Schuchardt2023-07-20 09:12:50 +0200
commit6287021ff9143718310075c414e535f1679a3929 (patch)
treeecf581714c110312062ec70302e2e1ba2334cbc7 /lib/efi_loader
parent5dcfc99b2b17fa1497adea47a50bf7c7a6ba5709 (diff)
efi_loader: simplify efi_uninstall_protocol()
The call to efi_search_obj() is redundant as the function is called in efi_search_protocol() too. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_boottime.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 2ca7359f3e1..69f2daa8acc 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1357,18 +1357,11 @@ static efi_status_t efi_uninstall_protocol
(efi_handle_t handle, const efi_guid_t *protocol,
void *protocol_interface)
{
- struct efi_object *efiobj;
struct efi_handler *handler;
struct efi_open_protocol_info_item *item;
struct efi_open_protocol_info_item *pos;
efi_status_t r;
- /* Check handle */
- efiobj = efi_search_obj(handle);
- if (!efiobj) {
- r = EFI_INVALID_PARAMETER;
- goto out;
- }
/* Find the protocol on the handle */
r = efi_search_protocol(handle, protocol, &handler);
if (r != EFI_SUCCESS)
@@ -1376,7 +1369,7 @@ static efi_status_t efi_uninstall_protocol
if (handler->protocol_interface != protocol_interface)
return EFI_NOT_FOUND;
/* Disconnect controllers */
- r = efi_disconnect_all_drivers(efiobj, protocol, NULL);
+ r = efi_disconnect_all_drivers(handle, protocol, NULL);
if (r != EFI_SUCCESS) {
r = EFI_ACCESS_DENIED;
goto out;