From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 B9EBC2277AF15 for ; Mon, 23 Apr 2018 01:17:34 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2018 01:17:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,317,1520924400"; d="scan'208";a="33914464" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by fmsmga007.fm.intel.com with ESMTP; 23 Apr 2018 01:17:33 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Hao Wu , Ruiyu Ni , Michael Turner Date: Mon, 23 Apr 2018 16:17:31 +0800 Message-Id: <1524471451-26604-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [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 08:17:35 -0000 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. 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(+) 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 = (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; } -- 2.7.0.windows.1