From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.3550.1576135622010292086 for ; Wed, 11 Dec 2019 23:27:02 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2019 23:27:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,305,1571727600"; d="scan'208";a="245599082" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 11 Dec 2019 23:27:00 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Dec 2019 23:27:00 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Dec 2019 23:27:00 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.90]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.222]) with mapi id 14.03.0439.000; Thu, 12 Dec 2019 15:26:58 +0800 From: "Ni, Ray" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Augustine, Linson" Subject: Re: [PATCH] ShellPkg/ShellProtocol: Return error code while fail parsing cmd-line Thread-Topic: [PATCH] ShellPkg/ShellProtocol: Return error code while fail parsing cmd-line Thread-Index: AQHVqKr6kmjGTUfzoEyQnQ5FWI9dMqe2KVVg Date: Thu, 12 Dec 2019 07:26:57 +0000 Deferred-Delivery: Thu, 12 Dec 2019 07:26:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C399AD5@SHSMSX104.ccr.corp.intel.com> References: <20191202005348.22208-1-zhichao.gao@intel.com> In-Reply-To: <20191202005348.22208-1-zhichao.gao@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmIzOGZiMTMtYjRkMS00MTZhLWIxYjQtMGQ0MjRkZjJjZjlmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSTdIendtSkF1Vm90UDZNRFFPU1wvMEh2MVBNQlJiME9uZGVtbkdrUllweWp6dmM4QVwvUU1aUkZ3M25yTmhrcUFKIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Gao, Zhichao > Sent: Monday, December 2, 2019 8:54 AM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Augustine, Linson > Subject: [PATCH] ShellPkg/ShellProtocol: Return error code while fail par= sing cmd-line >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2395 >=20 > Errors happened in the arguments parsing is not a critical error. > And it would miss the error status code in the release version of shell. > So replace the ASSERT with returning error status code while fail > parsing command-line in UpdateArgcArgv. >=20 > Cc: Ray Ni > Cc: Linson Augustine > Signed-off-by: Zhichao Gao > --- > ShellPkg/Application/Shell/ShellProtocol.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Applic= ation/Shell/ShellProtocol.c > index 5e529b6568..f0362a42d8 100644 > --- a/ShellPkg/Application/Shell/ShellProtocol.c > +++ b/ShellPkg/Application/Shell/ShellProtocol.c > @@ -1497,7 +1497,10 @@ InternalShellExecuteDevicePath( > ShellParamsProtocol.StdOut =3D ShellInfoObject.NewShellParametersPr= otocol->StdOut; > ShellParamsProtocol.StdErr =3D ShellInfoObject.NewShellParametersPr= otocol->StdErr; > Status =3D UpdateArgcArgv(&ShellParamsProtocol, NewCmdLine, Efi_Appl= ication, NULL, NULL); > - ASSERT_EFI_ERROR(Status); > + if (EFI_ERROR (Status)) { > + goto UnloadImage; > + } > + > // > // Replace Argv[0] with the full path of the binary we're executing: > // If the command line was "foo", the binary might be called "foo.ef= i". > -- > 2.21.0.windows.1