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.24; helo=mga09.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 326742277AF1A for ; Mon, 23 Apr 2018 04:25:38 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2018 04:25:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,318,1520924400"; d="scan'208";a="50046986" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 23 Apr 2018 04:25:38 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Apr 2018 04:25:37 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.240]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.210]) with mapi id 14.03.0319.002; Mon, 23 Apr 2018 19:25:35 +0800 From: "Wu, Hao A" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , Michael Turner Thread-Topic: [PATCH] MdeModulePkg NvmExpressDxe: return error code in error path Thread-Index: AQHT2tuMNpseHTGwBUOZZ+fi+OnqMqQONctg Date: Mon, 23 Apr 2018 11:25:35 +0000 Message-ID: References: <1524471451-26604-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1524471451-26604-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg NvmExpressDxe: return error code in error path X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 11:25:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: Zeng, Star > Sent: Monday, April 23, 2018 4:18 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star; Wu, Hao A; Ni, Ruiyu; Michael Turner > Subject: [PATCH] MdeModulePkg NvmExpressDxe: return error code in error > path >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D937 >=20 > In NvmeExpressPassthru.c near line 659: > Prp =3D NvmeCreatePrpList ( > PciIo, > PhyAddr, > EFI_SIZE_TO_PAGES(Offset + Bytes) - 1, > &PrpListHost, > &PrpListNo, > &MapPrpList > ); > if (Prp =3D=3D NULL) { > goto EXIT; > } > Status is not set to an error code - Status is initialized to > EFI_SUCCESS, or set by a PciIo->Map to EFI_SUCCESS above this > code. This error path should set Status to an error code before > goto EXIT. >=20 > Cc: Hao Wu > Cc: Ruiyu Ni > Cc: Michael Turner > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > index 302cfdcd8d8d..cfad1587f299 100644 > --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c > @@ -656,6 +656,7 @@ NvmExpressPassThru ( > PhyAddr =3D (Sq->Prp[0] + EFI_PAGE_SIZE) & ~(EFI_PAGE_SIZE - 1); > Prp =3D NvmeCreatePrpList (PciIo, PhyAddr, EFI_SIZE_TO_PAGES(Offset = + Bytes) > - 1, &PrpListHost, &PrpListNo, &MapPrpList); > if (Prp =3D=3D NULL) { > + Status =3D EFI_OUT_OF_RESOURCES; > goto EXIT; > } >=20 > -- > 2.7.0.windows.1