aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-09-04 22:46:13 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-09-05 23:18:51 +0200
commit03446987c5008fd1e3732b01fd63a29c7a6d9246 (patch)
treeb15c17a6cddd9b0290e32db73bd3b3522f8a2f7e /lib
parent97ea0690f4ea8b30f66fab7dc3bd439714647989 (diff)
downloadu-boot-03446987c5008fd1e3732b01fd63a29c7a6d9246.zip
u-boot-03446987c5008fd1e3732b01fd63a29c7a6d9246.tar.gz
u-boot-03446987c5008fd1e3732b01fd63a29c7a6d9246.tar.bz2
efi_loader: do not set invalid screen mode
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetMode() should return EFI_UNDEFINED if a screen mode is not available. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@csgraf.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_console.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 5560fc8..5109017 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -379,6 +379,10 @@ static efi_status_t EFIAPI efi_cout_set_mode(
if (mode_number >= efi_con_mode.max_mode)
return EFI_EXIT(EFI_UNSUPPORTED);
+
+ if (!efi_cout_modes[mode_number].present)
+ return EFI_EXIT(EFI_UNSUPPORTED);
+
efi_con_mode.mode = mode_number;
EFI_CALL(efi_cout_clear_screen(this));