From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.6266.1646126386729812009 for ; Tue, 01 Mar 2022 01:19:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=HoyW8ZSF; spf=pass (domain: intel.com, ip: 192.55.52.115, 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=1646126388; x=1677662388; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TDWuXXbQ/4egYJZn5URL6hbXS3C92TFj3h+8Fcbnm60=; b=HoyW8ZSFnxVJkJrSQbJ0/HylfuqeyKYitoD19Sv3Hq1Cr1jIxxlKvnkc p0bxhMxDNX7RpBG5mzi9IAoimst5yT2t4T8UuoZvq01CKBB8ubUBsVawF lSs4nCRoLaMR53MKOcSMDNjIpmoh0JwJDG/Pc8UJrf5zUzjmUsI7vQhQc hh/7GHFjMXbY4ew/OhCT8Vm7TIVJJT2186OpseDPEl79BsXuEmFa/VmQj qdPnaT4lhtiQGN686wG0Io/FYdRa31iYmLpQp+qQsNX/1vr2lDGrPEgOu sFYJigOrNnxoUhjRz+9tGOTO7osR7dxfWpXtt1kJ06TueGu/bQepCShja Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="253286519" X-IronPort-AV: E=Sophos;i="5.90,145,1643702400"; d="scan'208";a="253286519" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 01:19:48 -0800 X-IronPort-AV: E=Sophos;i="5.90,145,1643702400"; d="scan'208";a="708986771" Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 01:19:46 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao , Zhichao Gao , Ray Ni Subject: [PATCH v2 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Date: Tue, 1 Mar 2022 17:18:49 +0800 Message-Id: <20220301091850.828-2-guomin.jiang@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220301091850.828-1-guomin.jiang@intel.com> References: <20220301091850.828-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 Cc: 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