diff options
author | Guomin Jiang <guomin.jiang@intel.com> | 2022-02-20 14:53:01 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-03-03 05:17:46 +0000 |
commit | 906242343f7a654402f6f999d447aa9d29a8f4d4 (patch) | |
tree | 48006d5a13db0a671d8e504d0ec0f5448273635c /MdeModulePkg/Universal | |
parent | dc39554d58af4a50b50eca1f57c49415a12b0c98 (diff) | |
download | edk2-906242343f7a654402f6f999d447aa9d29a8f4d4.tar.gz edk2-906242343f7a654402f6f999d447aa9d29a8f4d4.tar.bz2 edk2-906242343f7a654402f6f999d447aa9d29a8f4d4.zip |
MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2668
SetMode will fail in some case. for example, without XServer.
Should handle these case when SetMode fail.
If we don't handle it, it will Segmentation fault.
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 8f0cba9fcd..07436cbd15 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -1,7 +1,7 @@ /** @file
This is the main routine for initializing the Graphics Console support routines.
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -518,7 +518,7 @@ GraphicsConsoleControllerDriverStart ( }
}
- if (ModeNumber != Private->GraphicsOutput->Mode->Mode) {
+ if (EFI_ERROR (Status) || (ModeNumber != Private->GraphicsOutput->Mode->Mode)) {
//
// Current graphics mode is not set or is not set to the mode which we have found,
// set the new graphic mode.
|