From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.4990.1646204359724057108 for ; Tue, 01 Mar 2022 22:59:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=hLva+xpB; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: guomin.jiang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646204360; x=1677740360; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Aovgpg2HBX6HifXGTl8CH096RNEX93ka+4f1178+t6E=; b=hLva+xpBSKAdwij39mY3aT/d5Px/HR14+X+ckgXw2JlyqmTnzM4Mi0qz 6HX70ZdNms+Hhnk5vRRk3JLNgcOPiyyAii8ZAWCby0uiyLoEyMOMZLfV6 00sDCxFm0fNpXZPXKRgIKeM1J0ne2P9XwLwfAb+5GV407J/L1ALHrIFwC /SrG3EdDWU1ruTA8G0hDrecgEP8eByGlYJ0r+vCreI+gTkoPu8oAqRJpT TTyCXAov+py3NBd4WQp9geaXNFOPAHC493G93aoNY9gAdcTjlwQoJeNsj US0ZSsHGdH6uMsBZW8xLLC7Amv+m8f4AXmw7yTkznlrK6IPjY6tYnCmL9 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="253250014" X-IronPort-AV: E=Sophos;i="5.90,148,1643702400"; d="scan'208";a="253250014" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 22:59:20 -0800 X-IronPort-AV: E=Sophos;i="5.90,148,1643702400"; d="scan'208";a="510890881" Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 22:59:18 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao , Zhichao Gao , Ray Ni Subject: [PATCH v3 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Date: Wed, 2 Mar 2022 14:58:55 +0800 Message-Id: <20220302065856.727-2-guomin.jiang@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220302065856.727-1-guomin.jiang@intel.com> References: <20220302065856.727-1-guomin.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Cc: Jian J Wang Cc: Liming Gao Cc: Zhichao Gao Reviewed-by: Ray Ni Signed-off-by: Guomin Jiang --- .../Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 8f0cba9fcde9..07436cbd15bf 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.
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
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. -- 2.35.1.windows.2