summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-04-23 16:13:23 +0800
committerStar Zeng <star.zeng@intel.com>2018-04-25 15:55:45 +0800
commit67d3e63c2c92dc9729e7f56b4fa8b4b47bfefe73 (patch)
treeb6d92a5470495a8707fbf8e9ecb49fcd51791698 /MdeModulePkg
parent3545488dd64c4bf9e7549d020112342985931ab1 (diff)
downloadedk2-67d3e63c2c92dc9729e7f56b4fa8b4b47bfefe73.tar.gz
edk2-67d3e63c2c92dc9729e7f56b4fa8b4b47bfefe73.tar.bz2
edk2-67d3e63c2c92dc9729e7f56b4fa8b4b47bfefe73.zip
MdeModulePkg NvmExpressDxe: return error code in error path
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=937 In NvmeExpressPassthru.c near line 659: Prp = NvmeCreatePrpList ( PciIo, PhyAddr, EFI_SIZE_TO_PAGES(Offset + Bytes) - 1, &PrpListHost, &PrpListNo, &MapPrpList ); if (Prp == 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. Change-Id: I8a5cdf981aa609534c205d3676395805ac60a003 Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
index 302cfdcd8d..cfad1587f2 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
@@ -656,6 +656,7 @@ NvmExpressPassThru (
PhyAddr = (Sq->Prp[0] + EFI_PAGE_SIZE) & ~(EFI_PAGE_SIZE - 1);
Prp = NvmeCreatePrpList (PciIo, PhyAddr, EFI_SIZE_TO_PAGES(Offset + Bytes) - 1, &PrpListHost, &PrpListNo, &MapPrpList);
if (Prp == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
goto EXIT;
}