From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Wed, 26 Jun 2019 19:13:26 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 19:13:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,422,1557212400"; d="scan'208";a="167263817" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 26 Jun 2019 19:13:26 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Jun 2019 19:13:26 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Jun 2019 19:13:25 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.185]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.104]) with mapi id 14.03.0439.000; Thu, 27 Jun 2019 10:13:23 +0800 From: "Ni, Ray" To: "Gao, Zhichao" CC: "devel@edk2.groups.io" Subject: Re: [edk2-devel] [PATCH] ShellPkg/UefiShellLib: Set input pointer parameter to null if failure Thread-Topic: [edk2-devel] [PATCH] ShellPkg/UefiShellLib: Set input pointer parameter to null if failure Thread-Index: AQHVIOYYhPNVGUI/cEuJaFx15xm3TqasDvXwgALK8fA= Date: Thu, 27 Jun 2019 02:13:23 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C1F24D9@SHSMSX104.ccr.corp.intel.com> References: <15A75ED256F2B18A.26095@groups.io> <3CE959C139B4C44DBEA1810E3AA6F9000B7F712B@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <3CE959C139B4C44DBEA1810E3AA6F9000B7F712B@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzYxOTk3MjMtYzYyNy00ZWJjLWI5MzYtNWE5ZjI4NDhhNDk4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSHFObFVzR292azZLWmpVM0pDQWNNQmlmcDBuY3BMZzJIbGtnU003WTV2K2R2bmlqMWlmTGdVOTVkSDlEVldYZyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 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: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Gao, Zhichao > Sent: Wednesday, June 12, 2019 2:14 PM > To: devel@edk2.groups.io > Cc: Bret Barkelew ; Carsey, Jaben > ; Ni, Ray ; Gao, Liming > ; Sean Brogan ; > Michael Turner > Subject: [edk2-devel] [PATCH] ShellPkg/UefiShellLib: Set input pointer > parameter to null if failure >=20 > From: Bret Barkelew >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1906 >=20 > While failed to allocate memory to save the response, set the input/outp= ut > parameter 'Response'(VOID **) to NULL to indicate the failure not only > depend on the returned status. >=20 > Cc: Jaben Carsey > Cc: Ray Ni > Cc: Liming Gao > Cc: Sean Brogan > Cc: Michael Turner > Cc: Bret Barkelew > Signed-off-by: Zhichao Gao > --- > ShellPkg/Library/UefiShellLib/UefiShellLib.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c > b/ShellPkg/Library/UefiShellLib/UefiShellLib.c > index 430b20e127..5be530092e 100644 > --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c > +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c > @@ -3366,6 +3366,9 @@ ShellPromptForResponse ( > if (Type !=3D ShellPromptResponseTypeFreeform) { > Resp =3D > (SHELL_PROMPT_RESPONSE*)AllocateZeroPool(sizeof(SHELL_PROMPT_RESP > ONSE)); > if (Resp =3D=3D NULL) { > + if (Response !=3D NULL) { > + *Response =3D NULL; > + } > return (EFI_OUT_OF_RESOURCES); > } > } > @@ -3568,6 +3571,8 @@ ShellPromptForResponse ( > *Response =3D Resp; > } else if (Buffer !=3D NULL) { > *Response =3D Buffer; > + } else { > + *Response =3D NULL; > } > } else { > if (Resp !=3D NULL) { > -- > 2.21.0.windows.1 >=20 >=20 >=20