summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-05 11:24:53 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-07 21:10:04 +0200
commite7c3cd6b67d87383fa48b41c1b4037b75ceab597 (patch)
tree59539a0c8393a108868c1106e8b53a1595890b02 /lib/efi_loader
parent529886a097c2f4e3b7692dcbd4da8d2b4dcf0c2a (diff)
efi_loader: HandleProtocol parameter checks
HandleProtocol() and OpenProtocol() have to return EFI_UNSUPPORTED if the protocol is not installed on the handle. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_boottime.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index ab299aa17f..6d86dafc16 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2636,8 +2636,15 @@ static efi_status_t EFIAPI efi_open_protocol
}
r = efi_search_protocol(handle, protocol, &handler);
- if (r != EFI_SUCCESS)
+ switch (r) {
+ case EFI_SUCCESS:
+ break;
+ case EFI_NOT_FOUND:
+ r = EFI_UNSUPPORTED;
goto out;
+ default:
+ goto out;
+ }
r = efi_protocol_open(handler, protocol_interface, agent_handle,
controller_handle, attributes);