linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arvind Sankar <nivedita@alum.mit.edu>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-efi@vger.kernel.org
Subject: [PATCH v2 1/3] efi/gop: Return EFI_NOT_FOUND if there are no usable GOP's
Date: Wed,  4 Dec 2019 13:17:42 -0500	[thread overview]
Message-ID: <20191204181744.14326-2-nivedita@alum.mit.edu> (raw)
In-Reply-To: <20191203214728.19264-1-nivedita@alum.mit.edu>

If we don't find a usable GOP because none of them have a framebuffer
(i.e. they were all PIXEL_BLT_ONLY), but all the efi calls succeeded, we
will return EFI_SUCCESS even though we didn't find a usable GOP.

Fix this by explicitly returning EFI_NOT_FOUND if no usable GOP's are
found, allowing the caller to probe for UGA instead.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
---
 drivers/firmware/efi/libstub/gop.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c
index 0101ca4c13b1..62e8b7cff72f 100644
--- a/drivers/firmware/efi/libstub/gop.c
+++ b/drivers/firmware/efi/libstub/gop.c
@@ -175,7 +175,7 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
 
 	/* Did we find any GOPs? */
 	if (!first_gop)
-		goto out;
+		return EFI_NOT_FOUND;
 
 	/* EFI framebuffer */
 	si->orig_video_isVGA = VIDEO_TYPE_EFI;
@@ -197,7 +197,7 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
 	si->lfb_size = si->lfb_linelength * si->lfb_height;
 
 	si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS;
-out:
+
 	return status;
 }
 
@@ -293,7 +293,7 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si,
 
 	/* Did we find any GOPs? */
 	if (!first_gop)
-		goto out;
+		return EFI_NOT_FOUND;
 
 	/* EFI framebuffer */
 	si->orig_video_isVGA = VIDEO_TYPE_EFI;
@@ -315,7 +315,7 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si,
 	si->lfb_size = si->lfb_linelength * si->lfb_height;
 
 	si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS;
-out:
+
 	return status;
 }
 
-- 
2.23.0


  parent reply	other threads:[~2019-12-04 18:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 21:47 [PATCH 1/2] efi/gop: Fix return value of setup_gop32/64 Arvind Sankar
2019-12-03 21:47 ` [PATCH 2/2] efi/gop: Fix memory leak in __gop_query32/64 Arvind Sankar
2019-12-04 15:11   ` Ard Biesheuvel
2019-12-04 15:27     ` Arvind Sankar
2019-12-04 15:30       ` Ard Biesheuvel
2019-12-04 15:44         ` Arvind Sankar
2019-12-04 15:03 ` [PATCH 1/2] efi/gop: Fix return value of setup_gop32/64 Ard Biesheuvel
2019-12-04 15:23   ` Arvind Sankar
2019-12-04 15:28     ` Ard Biesheuvel
2019-12-04 15:45       ` Arvind Sankar
2019-12-04 18:17 ` [PATCH v2 0/3] Fix a couple of bugs in efi/gop.c Arvind Sankar
2019-12-05 12:06   ` Ard Biesheuvel
2019-12-04 18:17 ` Arvind Sankar [this message]
2019-12-04 18:17 ` [PATCH v2 2/3] efi/gop: Return EFI_SUCCESS if a usable GOP was found Arvind Sankar
2019-12-04 18:17 ` [PATCH v2 3/3] efi/gop: Fix memory leak from __gop_query32/64 Arvind Sankar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191204181744.14326-2-nivedita@alum.mit.edu \
    --to=nivedita@alum.mit.edu \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).