From 65b91a346ebed631494b6ad405dbd91e07157ec4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vincent=20Stehl=C3=A9?= Date: Fri, 6 Jan 2023 10:46:40 +0100 Subject: [PATCH] efi_loader: refine set_keyboard_layout() status MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As per the EFI specification, the HII database protocol function set_keyboard_layout() must return EFI_INVALID_PARAMETER when it is called with a NULL key_guid argument. Modify the function accordingly to improve conformance. Signed-off-by: Vincent Stehlé Cc: Heinrich Schuchardt Cc: Ilias Apalodimas Reviewed-by: Ilias Apalodimas --- lib/efi_loader/efi_hii.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c index 27db3be6a1..3b54ecb11a 100644 --- a/lib/efi_loader/efi_hii.c +++ b/lib/efi_loader/efi_hii.c @@ -758,6 +758,9 @@ set_keyboard_layout(const struct efi_hii_database_protocol *this, { EFI_ENTRY("%p, %pUs", this, key_guid); + if (!key_guid) + return EFI_EXIT(EFI_INVALID_PARAMETER); + return EFI_EXIT(EFI_NOT_FOUND); } -- 2.39.5