Skip to content

Commit

Permalink
x86/efi: Initialize status to ensure garbage is not returned on small…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Colin Ian King authored and Matt Fleming committed Sep 9, 2016
1 parent dce48e3 commit ac0e94b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/boot/compressed/eboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height)
efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
unsigned long nr_ugas;
u32 *handles = (u32 *)uga_handle;;
efi_status_t status;
efi_status_t status = EFI_INVALID_PARAMETER;
int i;

first_uga = NULL;
Expand Down Expand Up @@ -623,7 +623,7 @@ setup_uga64(void **uga_handle, unsigned long size, u32 *width, u32 *height)
efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
unsigned long nr_ugas;
u64 *handles = (u64 *)uga_handle;;
efi_status_t status;
efi_status_t status = EFI_INVALID_PARAMETER;
int i;

first_uga = NULL;
Expand Down

0 comments on commit ac0e94b

Please sign in to comment.