Skip to content

Commit ac0e94b

Browse files
Colin Ian Kingmfleming
authored andcommitted
x86/efi: Initialize status to ensure garbage is not returned on small size
Although very unlikey, if size is too small or zero, then we end up with status not being set and returning garbage. Instead, initializing status to EFI_INVALID_PARAMETER to indicate that size is invalid in the calls to setup_uga32 and setup_uga64. Signed-off-by: Colin Ian King <colin.king@canonical.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
1 parent dce48e3 commit ac0e94b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/boot/compressed/eboot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height)
578578
efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
579579
unsigned long nr_ugas;
580580
u32 *handles = (u32 *)uga_handle;;
581-
efi_status_t status;
581+
efi_status_t status = EFI_INVALID_PARAMETER;
582582
int i;
583583

584584
first_uga = NULL;
@@ -623,7 +623,7 @@ setup_uga64(void **uga_handle, unsigned long size, u32 *width, u32 *height)
623623
efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
624624
unsigned long nr_ugas;
625625
u64 *handles = (u64 *)uga_handle;;
626-
efi_status_t status;
626+
efi_status_t status = EFI_INVALID_PARAMETER;
627627
int i;
628628

629629
first_uga = NULL;

0 commit comments

Comments
 (0)