Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1447142 > unrolled thread

[PATCH] x86/efi: initialize status to ensure garbage is not returned on small size

Started byColin King <colin.king@canonical.com>
First post2016-07-20 12:20 +0200
Last post2016-07-20 12:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/efi: initialize status to ensure garbage is not returned on small size Colin King <colin.king@canonical.com> - 2016-07-20 12:20 +0200

#1447142 — [PATCH] x86/efi: initialize status to ensure garbage is not returned on small size

FromColin King <colin.king@canonical.com>
Date2016-07-20 12:20 +0200
Subject[PATCH] x86/efi: initialize status to ensure garbage is not returned on small size
Message-ID<rWWLD-4Q-5@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

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>
---
 arch/x86/boot/compressed/eboot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index ff574da..ec6d2ef 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -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;
@@ -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;
-- 
2.8.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web