From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2EA3121E781E0 for ; Tue, 3 Oct 2017 16:53:06 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 03 Oct 2017 16:56:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,475,1500966000"; d="scan'208";a="1021277808" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 03 Oct 2017 16:56:27 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 3 Oct 2017 16:56:27 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 3 Oct 2017 16:56:26 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Wed, 4 Oct 2017 07:56:24 +0800 From: "Zeng, Star" To: Ard Biesheuvel , "edk2-devel@lists.01.org" , "Dong, Eric" CC: "leif.lindholm@linaro.org" , "Ni, Ruiyu" , "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg/UefiBootManagerLib: don't ASSERT on 'BootNext' varname Thread-Index: AQHTPGuLwZCwDLQGMUS+/OYgpm51o6LSy5/w Date: Tue, 3 Oct 2017 23:56:24 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B97E276@shsmsx102.ccr.corp.intel.com> References: <20171003171727.5641-1-ard.biesheuvel@linaro.org> In-Reply-To: <20171003171727.5641-1-ard.biesheuvel@linaro.org> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/UefiBootManagerLib: don't ASSERT on 'BootNext' varname X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 23:53:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ard, To me, the ASSERT there seems on purpose to help catch the misuse of that i= nterface. Could you share the case you met the ASSERT? Given that interface is an open API of UefiBootManagerLib, some comments fo= r the behavior of ASSERT may can be added to be more clear. Cc Ruiyu who is the expert of this part code. Thanks, Star -----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]=20 Sent: Wednesday, October 4, 2017 1:17 AM To: edk2-devel@lists.01.org; Zeng, Star ; Dong, Eric <= eric.dong@intel.com> Cc: leif.lindholm@linaro.org; Ard Biesheuvel Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: don't ASSERT on 'BootNext= ' varname When invoking EfiBootManagerIsValidLoadOptionVariableName() with the variab= le name 'BootNext', we should simply return FALSE, given that it is not an = indexed Boot#### load option. However, in DEBUG mode, we will hit an assert= in BmCharToUint() and crash. So remove the assert. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c b/MdeModulePk= g/Library/UefiBootManagerLib/BmMisc.c index 11ab86792a52..a3fa25424592 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c @@ -420,7 +420,6 @@ BmCharToUint ( return (Char - L'A' + 0xA); } =20 - ASSERT (FALSE); return (UINTN) -1; } =20 -- 2.11.0